Skip to content

Commit 2ec3a32

Browse files
authored
Merge pull request #159 from sx-aurora-dev/feature/merge-upstream-20220214
Feature/merge upstream 20220214
2 parents 6d1267e + b882697 commit 2ec3a32

File tree

2,615 files changed

+68930
-35173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,615 files changed

+68930
-35173
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,25 @@ This is an example work-flow and configuration to get and build the LLVM source:
6363

6464
Some common options:
6565

66-
* ``-DLLVM_ENABLE_PROJECTS='...'`` --- semicolon-separated list of the LLVM
67-
sub-projects you'd like to additionally build. Can include any of: clang,
68-
clang-tools-extra, compiler-rt,cross-project-tests, flang, libc, libclc,
69-
libcxx, libcxxabi, libunwind, lld, lldb, mlir, openmp, polly, or pstl.
66+
* ``-DLLVM_ENABLE_PROJECTS='...'`` and ``-DLLVM_ENABLE_RUNTIMES='...'`` ---
67+
semicolon-separated list of the LLVM sub-projects and runtimes you'd like to
68+
additionally build. ``LLVM_ENABLE_PROJECTS`` can include any of: clang,
69+
clang-tools-extra, cross-project-tests, flang, libc, libclc, lld, lldb,
70+
mlir, openmp, polly, or pstl. ``LLVM_ENABLE_RUNTIMES`` can include any of
71+
libcxx, libcxxabi, libunwind, compiler-rt, libc or openmp. Some runtime
72+
projects can be specified either in ``LLVM_ENABLE_PROJECTS`` or in
73+
``LLVM_ENABLE_RUNTIMES``.
7074

7175
For example, to build LLVM, Clang, libcxx, and libcxxabi, use
72-
``-DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi"``.
76+
``-DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"``.
7377

7478
* ``-DCMAKE_INSTALL_PREFIX=directory`` --- Specify for *directory* the full
7579
path name of where you want the LLVM tools and libraries to be installed
76-
(default ``/usr/local``).
80+
(default ``/usr/local``). Be careful if you install runtime libraries: if
81+
your system uses those provided by LLVM (like libc++ or libc++abi), you
82+
must not overwrite your system's copy of those libraries, since that
83+
could render your system unusable. In general, using something like
84+
``/usr`` is not advised, but ``/usr/local`` is fine.
7785

7886
* ``-DCMAKE_BUILD_TYPE=type`` --- Valid options for *type* are Debug,
7987
Release, RelWithDebInfo, and MinSizeRel. Default is Debug.

bolt/docs/OptimizingClang.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Collecting accurate profile requires running `perf` on a hardware that
4141
implements taken branch sampling (`-b/-j` flag). For that reason, it may not be possible to
4242
collect the accurate profile in a virtualized environment, e.g. in the cloud.
4343
We do support regular sampling profiles, but the performance
44-
improvements are expected to be more modest.
44+
improvements are expected to be more modest.
4545

4646
```bash
4747
$ mkdir ${TOPLEV}/stage3
@@ -211,7 +211,8 @@ $ cd ${TOPLEV}/stage1
211211
$ cmake -G Ninja ${TOPLEV}/llvm-project/llvm -DLLVM_TARGETS_TO_BUILD=X86 \
212212
-DCMAKE_BUILD_TYPE=Release \
213213
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_ASM_COMPILER=gcc \
214-
-DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \
214+
-DLLVM_ENABLE_PROJECTS="clang;lld" \
215+
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
215216
-DCOMPILER_RT_BUILD_SANITIZERS=OFF -DCOMPILER_RT_BUILD_XRAY=OFF \
216217
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
217218
-DCMAKE_INSTALL_PREFIX=${TOPLEV}/stage1/install

bolt/include/bolt/Rewrite/DWARFRewriter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define BOLT_REWRITE_DWARF_REWRITER_H
1111

1212
#include "bolt/Core/DebugData.h"
13+
#include "llvm/MC/MCAsmLayout.h"
1314
#include <cstdint>
1415
#include <memory>
1516
#include <mutex>

clang-tools-extra/clang-doc/Serialize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ template <typename T>
357357
static void
358358
populateParentNamespaces(llvm::SmallVector<Reference, 4> &Namespaces,
359359
const T *D, bool &IsInAnonymousNamespace) {
360-
const auto *DC = dyn_cast<DeclContext>(D);
360+
const auto *DC = cast<DeclContext>(D);
361361
while ((DC = DC->getParent())) {
362362
if (const auto *N = dyn_cast<NamespaceDecl>(DC)) {
363363
std::string Namespace;

clang-tools-extra/clang-tidy/bugprone/VirtualNearMissCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ static bool checkOverridingFunctionReturnType(const ASTContext *Context,
4040
const CXXMethodDecl *BaseMD,
4141
const CXXMethodDecl *DerivedMD) {
4242
QualType BaseReturnTy = BaseMD->getType()
43-
->getAs<FunctionType>()
43+
->castAs<FunctionType>()
4444
->getReturnType()
4545
.getCanonicalType();
4646
QualType DerivedReturnTy = DerivedMD->getType()
47-
->getAs<FunctionType>()
47+
->castAs<FunctionType>()
4848
->getReturnType()
4949
.getCanonicalType();
5050

clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void ProBoundsConstantArrayIndexCheck::check(
7171
BaseRange = ArraySubscriptE->getBase()->getSourceRange();
7272
else
7373
BaseRange =
74-
dyn_cast<CXXOperatorCallExpr>(Matched)->getArg(0)->getSourceRange();
74+
cast<CXXOperatorCallExpr>(Matched)->getArg(0)->getSourceRange();
7575
SourceRange IndexRange = IndexExpr->getSourceRange();
7676

7777
auto Diag = diag(Matched->getExprLoc(),

clang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace llvm_libc {
2222
// Unit.
2323
const DeclContext *getOutermostNamespace(const DeclContext *Decl) {
2424
const DeclContext *Parent = Decl->getParent();
25-
if (Parent && Parent->isTranslationUnit())
25+
if (Parent->isTranslationUnit())
2626
return Decl;
2727
return getOutermostNamespace(Parent);
2828
}

clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void UseNoexceptCheck::check(const MatchFinder::MatchResult &Result) {
6565
} else if (const auto *ParmDecl =
6666
Result.Nodes.getNodeAs<ParmVarDecl>("parmVarDecl")) {
6767
FnTy = ParmDecl->getType()
68-
->getAs<Type>()
68+
->castAs<Type>()
6969
->getPointeeType()
7070
->getAs<FunctionProtoType>();
7171

clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,14 +404,17 @@ void UseTrailingReturnTypeCheck::check(const MatchFinder::MatchResult &Result) {
404404
const auto *Fr = Result.Nodes.getNodeAs<FriendDecl>("Friend");
405405
assert(F && "Matcher is expected to find only FunctionDecls");
406406

407-
if (F->getLocation().isInvalid())
407+
// Three-way comparison operator<=> is syntactic sugar and generates implicit
408+
// nodes for all other operators.
409+
if (F->getLocation().isInvalid() || F->isImplicit())
408410
return;
409411

410-
// Skip functions which return just 'auto'.
412+
// Skip functions which return 'auto' and defaulted operators.
411413
const auto *AT = F->getDeclaredReturnType()->getAs<AutoType>();
412-
if (AT != nullptr && !AT->isConstrained() &&
413-
AT->getKeyword() == AutoTypeKeyword::Auto &&
414-
!hasAnyNestedLocalQualifiers(F->getDeclaredReturnType()))
414+
if (AT != nullptr &&
415+
((!AT->isConstrained() && AT->getKeyword() == AutoTypeKeyword::Auto &&
416+
!hasAnyNestedLocalQualifiers(F->getDeclaredReturnType())) ||
417+
F->isDefaulted()))
415418
return;
416419

417420
// TODO: implement those

clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static void replaceCallWithArg(const CallExpr *Call, DiagnosticBuilder &Diag,
3737

3838
void MoveConstArgCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
3939
Options.store(Opts, "CheckTriviallyCopyableMove", CheckTriviallyCopyableMove);
40+
Options.store(Opts, "CheckMoveToConstRef", CheckMoveToConstRef);
4041
}
4142

4243
void MoveConstArgCheck::registerMatchers(MatchFinder *Finder) {
@@ -193,7 +194,7 @@ void MoveConstArgCheck::check(const MatchFinder::MatchResult &Result) {
193194
<< (InvocationParm->getFunctionScopeIndex() + 1) << FunctionName
194195
<< *InvocationParmType << ExpectParmTypeName;
195196
}
196-
} else if (ReceivingExpr) {
197+
} else if (ReceivingExpr && CheckMoveToConstRef) {
197198
if ((*InvocationParmType)->isRValueReferenceType())
198199
return;
199200

0 commit comments

Comments
 (0)