aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-19 07:02:30 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-19 07:02:30 +0000
commitde51d671486b6ac9a2ad9ee5fcfdb1a23cc59238 (patch)
tree17ff629bd1f00b82d8dbb66a022e2f59e218c3c2 /tools
parent8746d127c04f5bbaf6c6e88cef8606ca5a6a54e9 (diff)
downloadsrc-de51d671486b6ac9a2ad9ee5fcfdb1a23cc59238.tar.gz
src-de51d671486b6ac9a2ad9ee5fcfdb1a23cc59238.zip
Vendor import of clang trunk r308421:vendor/clang/clang-trunk-r308421
Notes
Notes: svn path=/vendor/clang/dist/; revision=321186 svn path=/vendor/clang/clang-trunk-r308421/; revision=321187; tag=vendor/clang/clang-trunk-r308421
Diffstat (limited to 'tools')
-rw-r--r--tools/clang-fuzzer/CMakeLists.txt3
-rw-r--r--tools/clang-fuzzer/ClangFuzzer.cpp11
-rw-r--r--tools/libclang/ARCMigrate.cpp1
-rw-r--r--tools/libclang/CIndex.cpp19
-rw-r--r--tools/libclang/CXType.cpp2
-rw-r--r--tools/scan-build-py/libscanbuild/analyze.py2
6 files changed, 32 insertions, 6 deletions
diff --git a/tools/clang-fuzzer/CMakeLists.txt b/tools/clang-fuzzer/CMakeLists.txt
index 87d21c6bf116..a4ea4ca19cdd 100644
--- a/tools/clang-fuzzer/CMakeLists.txt
+++ b/tools/clang-fuzzer/CMakeLists.txt
@@ -1,5 +1,5 @@
if( LLVM_USE_SANITIZE_COVERAGE )
- set(LLVM_LINK_COMPONENTS support)
+ set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD})
add_clang_executable(clang-fuzzer
EXCLUDE_FROM_ALL
@@ -10,6 +10,7 @@ if( LLVM_USE_SANITIZE_COVERAGE )
${CLANG_FORMAT_LIB_DEPS}
clangAST
clangBasic
+ clangCodeGen
clangDriver
clangFrontend
clangRewriteFrontend
diff --git a/tools/clang-fuzzer/ClangFuzzer.cpp b/tools/clang-fuzzer/ClangFuzzer.cpp
index 1692882c0b5f..9eceb843e581 100644
--- a/tools/clang-fuzzer/ClangFuzzer.cpp
+++ b/tools/clang-fuzzer/ClangFuzzer.cpp
@@ -14,18 +14,25 @@
//===----------------------------------------------------------------------===//
#include "clang/Tooling/Tooling.h"
-#include "clang/Frontend/FrontendActions.h"
+#include "clang/CodeGen/CodeGenAction.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "llvm/Option/Option.h"
+#include "llvm/Support/TargetSelect.h"
using namespace clang;
extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
std::string s((const char *)data, size);
+ llvm::InitializeAllTargets();
+ llvm::InitializeAllTargetMCs();
+ llvm::InitializeAllAsmPrinters();
+ llvm::InitializeAllAsmParsers();
+
llvm::opt::ArgStringList CC1Args;
CC1Args.push_back("-cc1");
CC1Args.push_back("./test.cc");
+ CC1Args.push_back("-O2");
llvm::IntrusiveRefCntPtr<FileManager> Files(
new FileManager(FileSystemOptions()));
IgnoringDiagConsumer Diags;
@@ -39,7 +46,7 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
llvm::MemoryBuffer::getMemBuffer(s);
Invocation->getPreprocessorOpts().addRemappedFile("./test.cc", Input.release());
std::unique_ptr<tooling::ToolAction> action(
- tooling::newFrontendActionFactory<clang::SyntaxOnlyAction>());
+ tooling::newFrontendActionFactory<clang::EmitObjAction>());
std::shared_ptr<PCHContainerOperations> PCHContainerOps =
std::make_shared<PCHContainerOperations>();
action->runInvocation(std::move(Invocation), Files.get(), PCHContainerOps,
diff --git a/tools/libclang/ARCMigrate.cpp b/tools/libclang/ARCMigrate.cpp
index 44a60c4e3e2c..0f2bd06db4b4 100644
--- a/tools/libclang/ARCMigrate.cpp
+++ b/tools/libclang/ARCMigrate.cpp
@@ -14,6 +14,7 @@
#include "clang-c/Index.h"
#include "CXString.h"
#include "clang/ARCMigrate/ARCMT.h"
+#include "clang/Config/config.h"
#include "clang/Frontend/TextDiagnosticBuffer.h"
#include "llvm/Support/FileSystem.h"
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 236f264c1758..d527535a17c1 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -2264,6 +2264,23 @@ void OMPClauseEnqueue::VisitOMPReductionClause(const OMPReductionClause *C) {
Visitor->AddStmt(E);
}
}
+void OMPClauseEnqueue::VisitOMPTaskReductionClause(
+ const OMPTaskReductionClause *C) {
+ VisitOMPClauseList(C);
+ VisitOMPClauseWithPostUpdate(C);
+ for (auto *E : C->privates()) {
+ Visitor->AddStmt(E);
+ }
+ for (auto *E : C->lhs_exprs()) {
+ Visitor->AddStmt(E);
+ }
+ for (auto *E : C->rhs_exprs()) {
+ Visitor->AddStmt(E);
+ }
+ for (auto *E : C->reduction_ops()) {
+ Visitor->AddStmt(E);
+ }
+}
void OMPClauseEnqueue::VisitOMPLinearClause(const OMPLinearClause *C) {
VisitOMPClauseList(C);
VisitOMPClauseWithPostUpdate(C);
@@ -8195,7 +8212,7 @@ cxindex::checkForMacroInMacroDefinition(const MacroInfo *MI, const Token &Tok,
return nullptr;
// Check that the identifier is not one of the macro arguments.
- if (std::find(MI->arg_begin(), MI->arg_end(), &II) != MI->arg_end())
+ if (std::find(MI->param_begin(), MI->param_end(), &II) != MI->param_end())
return nullptr;
MacroDirective *InnerMD = PP.getLocalMacroDirectiveHistory(&II);
diff --git a/tools/libclang/CXType.cpp b/tools/libclang/CXType.cpp
index 5875459734a2..d2cb50905915 100644
--- a/tools/libclang/CXType.cpp
+++ b/tools/libclang/CXType.cpp
@@ -611,7 +611,7 @@ CXCallingConv clang_getFunctionTypeCallingConv(CXType X) {
TCALLINGCONV(X86Pascal);
TCALLINGCONV(X86RegCall);
TCALLINGCONV(X86VectorCall);
- TCALLINGCONV(X86_64Win64);
+ TCALLINGCONV(Win64);
TCALLINGCONV(X86_64SysV);
TCALLINGCONV(AAPCS);
TCALLINGCONV(AAPCS_VFP);
diff --git a/tools/scan-build-py/libscanbuild/analyze.py b/tools/scan-build-py/libscanbuild/analyze.py
index a09c72389d76..b5614b5b6da0 100644
--- a/tools/scan-build-py/libscanbuild/analyze.py
+++ b/tools/scan-build-py/libscanbuild/analyze.py
@@ -249,7 +249,7 @@ def analyzer_params(args):
if args.output_format:
result.append('-analyzer-output={0}'.format(args.output_format))
if args.analyzer_config:
- result.append(args.analyzer_config)
+ result.extend(['-analyzer-config', args.analyzer_config])
if args.verbose >= 4:
result.append('-analyzer-display-progress')
if args.plugins: