summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Update Clang fuzzers to use libFuzzer bundled with the toolchain.George Karpenkov2017-08-232-5/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D37043 llvm-svn: 311516
* [clang-diff] Refactor stop-after command-line flagJacob Gravelle2017-08-221-1/+1
| | | | | | | | | | | | | | | Summary: Rename stop-after to stop-diff-after. When building LLVM with -DLLVM_BUILD_LLVM_DYLIB=ON, stop-after collides with the stop-after already present in LLVM. Reviewers: johannes, arphaman Subscribers: klimek, aheejin, cfe-commits Differential Revision: https://reviews.llvm.org/D36989 llvm-svn: 311476
* [clang-format] Fix lines regression in clang-format.pyKrasimir Georgiev2017-08-221-1/+1
| | | | | | | | | | | | | | | | Summary: This patch fixes a regression after https://reviews.llvm.org/rL305665, which updates the structure of the `lines` variable. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37011 llvm-svn: 311456
* [clang-proto-fuzzer] Update README.Matt Morehouse2017-08-211-8/+15
| | | | | | Add instructions on how to modify the compiler invocation. llvm-svn: 311345
* [clang-diff] Improve and test getNodeValueJohannes Altmanninger2017-08-201-0/+12
| | | | | | | | | | | | Summary: Use qualified names if available. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36186 llvm-svn: 311292
* [clang-diff] Fix similarity computationJohannes Altmanninger2017-08-201-0/+13
| | | | | | | | | | | | | | Summary: Add separate tests for the top-down and the bottom-up phase, as well as one for the optimal matching. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36185 llvm-svn: 311284
* [clang-diff] Fix compiler warningJohannes Altmanninger2017-08-191-0/+1
| | | | llvm-svn: 311249
* [clang-diff] Add HTML side-by-side diff outputJohannes Altmanninger2017-08-192-0/+173
| | | | | | | | | | Reviewers: arphaman Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D36182 llvm-svn: 311241
* [clang-diff] Fix warning about useless comparisonJohannes Altmanninger2017-08-191-1/+1
| | | | llvm-svn: 311240
* [clang-diff] Make printing of matches optionalJohannes Altmanninger2017-08-191-1/+5
| | | | | | | | | | Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36181 llvm-svn: 311237
* [clang-diff] Add option to dump the AST, one node per lineJohannes Altmanninger2017-08-191-2/+20
| | | | | | | | | | | | Summary: This is done with -ast-dump; the JSON variant has been renamed to -ast-dump-json. Reviewers: arphaman Differential Revision: https://reviews.llvm.org/D36180 llvm-svn: 311232
* Revert "Revert "[clang-diff] Move printing of matches and changes to ↵Johannes Altmanninger2017-08-191-6/+67
| | | | | | | | | | clang-diff"" Fix build by renaming ChangeKind -> Change This reverts commit 0c78c5729f29315d7945988efd048c0cb86c07ce. llvm-svn: 311222
* Revert "Revert "[clang-diff] Move the JSON export function to clang-diff""Johannes Altmanninger2017-08-191-1/+64
| | | | | | | This reverts commit eac4c13ac9ea8f12bc049e040c7b9c8a517f54e7, the original commit *should* not have caused the build failure. llvm-svn: 311216
* Revert "[clang-diff] Move the JSON export function to clang-diff"Vlad Tsyrklevich2017-08-181-64/+1
| | | | | | This reverts commit r311199, it was causing widespread build failures. llvm-svn: 311211
* Revert "[clang-diff] Move printing of matches and changes to clang-diff"Vlad Tsyrklevich2017-08-181-67/+6
| | | | | | This reverts commit r311200, it was causing widespread build failures. llvm-svn: 311210
* [clang-diff] Move printing of matches and changes to clang-diffJohannes Altmanninger2017-08-181-6/+67
| | | | | | | | | | | | | | | Summary: This also changes the output order of the changes. Now the matches are printed in pre-order, intertwined with insertions, updates, and moves. Deletions are printed afterwards. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36179 llvm-svn: 311200
* [clang-diff] Move the JSON export function to clang-diffJohannes Altmanninger2017-08-181-1/+64
| | | | | | | | | | Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36178 llvm-svn: 311199
* [clang-proto-fuzzer] Allow user-specified compiler arguments.Matt Morehouse2017-08-181-1/+17
| | | | | | | | | | | | | | | | | | | Summary: Arguments can be specified after -ignore_remaining_args=1 to modify the compiler invocation. For example, the following command-line will fuzz LLVM with a custom optimization level and target triple: clang-proto-fuzzer CORPUS/ -ignore_remaining_args -O3 \ -triple arm64-apple-ios9 Reviewers: vitalybuka, kcc Reviewed By: vitalybuka Subscribers: aemerson, cfe-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D36882 llvm-svn: 311185
* [clang-diff] Add commandline arguments.Johannes Altmanninger2017-08-181-18/+54
| | | | | | | | | | | | | | | | Summary: Support command line options for build path and extra arguments This emulates the options accepted by clang tools that use CommonOptionsParser. Add a flag for controlling the maximum size parameter for bottom up matching. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36177 llvm-svn: 311173
* [index] Add indexing for unresolved-using declarationsBen Langmuir2017-08-161-0/+1
| | | | | | | | | | | In dependent contexts we end up referencing these, so make sure they have USRs, and have their declarations indexed. For the most part they behave like typedefs, but we also need to worry about having multiple using declarations with the same "name". rdar://problem/33883650 llvm-svn: 311053
* clang-format: add an option -verbose to list the files being processedSylvestre Ledru2017-08-121-16/+16
| | | | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D34824 llvm-svn: 310778
* Add a Dockerfile for clang-proto-fuzzerKostya Serebryany2017-08-122-0/+39
| | | | | | | | | | | | | | Summary: Add a Dockerfile for clang-proto-fuzzer Reviewers: morehouse, vitalybuka Reviewed By: morehouse Subscribers: hintonda, cfe-commits Differential Revision: https://reviews.llvm.org/D36635 llvm-svn: 310774
* [clang-fuzzer] Resolve proto dependenciesVitaly Buka2017-08-091-1/+4
| | | | llvm-svn: 310441
* Integrate Kostya's clang-proto-fuzzer with LLVM.Matt Morehouse2017-08-0812-43/+503
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The clang-proto-fuzzer models a subset of C++ as a protobuf and uses libprotobuf-mutator to generate interesting mutations of C++ programs. Clang-proto-fuzzer has already found several bugs in Clang (e.g., https://bugs.llvm.org/show_bug.cgi?id=33747, https://bugs.llvm.org/show_bug.cgi?id=33749). As with clang-fuzzer, clang-proto-fuzzer requires the following cmake flags: - CMAKE_C_COMPILER=clang - CMAKE_CXX_COMPILER=clang++ - LLVM_USE_SANITIZE_COVERAGE=YES // needed for libFuzzer - LLVM_USE_SANITIZER=Address // needed for libFuzzer In addition, clang-proto-fuzzer requires: - CLANG_ENABLE_PROTO_FUZZER=ON clang-proto-fuzzer also requires the following dependencies: - binutils // needed for libprotobuf-mutator - liblzma-dev // needed for libprotobuf-mutator - libz-dev // needed for libprotobuf-mutator - docbook2x // needed for libprotobuf-mutator - Recent version of protobuf [3.3.0 is known to work] A working version of libprotobuf-mutator will automatically be downloaded and built as an external project. Implementation of clang-proto-fuzzer provided by Kostya Serebryany. https://bugs.llvm.org/show_bug.cgi?id=33829 Reviewers: kcc, vitalybuka, bogner Reviewed By: kcc, vitalybuka Subscribers: thakis, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D36324 llvm-svn: 310408
* This adds the argument --dump-ir to clang-import-test, which allows Sean Callanan2017-08-071-3/+11
| | | | | | | | | | | | | | | | | | | | | viewing of the final IR. This is useful for confirming that structure layout was correct. I've added two tests: - A test that checks that structs in top-level code are completed correctly during struct layout (they are) - A test that checks that structs defined in function bodies are cpmpleted correctly during struct layout (currently they are not, so this is XFAIL). The second test fails because LookupSameContext() (ExternalASTMerger.cpp) can't find the struct. This is an issue I intend to resolve separately. Differential Revision: https://reviews.llvm.org/D36429 llvm-svn: 310318
* [libclang] Determinize order of platform availability attrsReid Kleckner2017-08-041-1/+2
| | | | | | | | | | Previously this code was doing std::sort on IdentifierInfo pointers. Now it sorts alphabetically by platform name. This should de-flake clang/test/Index/availability.c, which was failing non-deterministically for me. llvm-svn: 310138
* [diagtool] Add ability to pass in the id and return the name for aDon Hinton2017-08-031-1/+17
| | | | | | | | particular diagnostic. Differential Revision: https://reviews.llvm.org/D36252 llvm-svn: 309955
* Update for llvm change.Rafael Espindola2017-08-021-1/+1
| | | | llvm-svn: 309885
* [CMake][Modules] libclang: Ignore _CINDEX_LIB_ and CLANG_TOOL_EXTRA_BUILD ↵NAKAMURA Takumi2017-07-311-0/+9
| | | | | | | | | | | | | for -fmodules. CLANG_TOOL_EXTRA_BUILD doesn't affect headers. _CINDEX_LIB_ is defined when the target is SHARED. On Win32, it affects clang-c/Platform.h and it shouldn't be ignored. This is part of https://reviews.llvm.org/D35559 llvm-svn: 309557
* [clang-diff] Rename, NFCJohannes Altmanninger2017-07-271-2/+2
| | | | llvm-svn: 309276
* [OPENMP] Codegen for 'in_reduction' clause.Alexey Bataev2017-07-271-0/+2
| | | | | | | | | | | | | | | | | | Added codegen for task-based directive with in_reduction clause. ``` <body> ``` The next code is emitted: ``` void *td; ... td = call i8* @__kmpc_task_reduction_init(); ... <type> *priv = (<type> *)call i8* @__kmpc_task_reduction_get_th_data(i32 GTID, i8* td, i8* <orig>) ``` llvm-svn: 309270
* Update after LLVM change r309087George Rimar2017-07-261-1/+2
| | | | llvm-svn: 309088
* Fix a bot by linking clang-import-test against libclangDriverSean Callanan2017-07-251-0/+1
| | | | llvm-svn: 309018
* [ExternalASTMerger] Import Objective-C classesSean Callanan2017-07-251-12/+27
| | | | | | | | | | | | | This patch adds functionality and a test for importing Objective-C classes and their methods. It also adds a flag to clang-import-test to set the language used for parsing. This takes the same argument format as the -x option to the driver. Differential Revision: https://reviews.llvm.org/D35274 llvm-svn: 309014
* [OPENMP] Codegen for 'task_reduction' clause.Alexey Bataev2017-07-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added codegen for taskgroup directive with task_reduction clause. ``` <body> ``` The next code is emitted: ``` %struct.kmp_task_red_input_t red_init[n]; void *td; call void @__kmpc_taskgroup(%ident_t id, i32 gtid) ... red_init[i].shar = &<item>; red_init[i].size = sizeof(<item>); red_init[i].init = (void*)initializer_function; red_init[i].fini = (void*)destructor_function; red_init[i].comb = (void*)combiner_function; red_init[i].flags = flags; ... td = call i8* @__kmpc_task_reduction_init(i32 gtid, i32 n, i8* (void*)red_init); call void @__kmpc_end_taskgroup(%ident_t id, i32 gtid) void initializer_function(i8* priv) { *(<type>*)priv = <red_init>; ret void; } void destructor_function(i8* priv) { (<type>*)priv->~(); ret void; } void combiner_function(i8* inout, i8* in) { *(<type>*)inout = *(<type>*)inout <red_id> *(<type>*)in; ret void; } ``` llvm-svn: 308979
* [OPENMP] Initial support for 'in_reduction' clause.Alexey Bataev2017-07-211-0/+17
| | | | | | | Parsing/sema analysis for 'in_reduction' clause for task-based directives. llvm-svn: 308768
* [clang-diff] Add initial implementationAlex Lorenz2017-07-213-0/+124
| | | | | | | | | | | | | | This is the first commit for the "Clang-based C/C++ diff tool" GSoC project. ASTDiff is a new library that computes a structural AST diff between two ASTs using the gumtree algorithm. Clang-diff is a new Clang tool that will show the structural code changes between different ASTs. Patch by Johannes Altmanninger! Differential Revision: https://reviews.llvm.org/D34329 llvm-svn: 308731
* [scan-build-py] Patch to fix "-analyzer-config" optionPetr Hosek2017-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | I noticed that when I use "-analyze-config" option in scan-build-py, it behaves differently from original perl based scan-build. For example, command: $ scan-build -analyzer-config ipa=basic-inlining make Will work without any issues on perl version of scan-build. But on scan-build-py it will throw an error message "error reading 'ipa=basic-inlining'". After debugging, it turns out that the scan-build-py does not put "-analyzer-config" flag in front of the analyzer config flags (in this case is the "ipa=basic-inlining") in the final clang command line. This patch fixes this issue. Patch by Haowei Wu Differential Revision: https://reviews.llvm.org/D34489 llvm-svn: 308401
* [OPENMP] Initial support for 'task_reduction' clause.Alexey Bataev2017-07-181-0/+17
| | | | | | Parsing/sema analysis of the 'task_reduction' clause. llvm-svn: 308352
* [CMake] Move CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) into ↵NAKAMURA Takumi2017-07-181-0/+1
| | | | | | | | | | | | | | clang/Config/config.h. LLVM_ENABLE_MODULES is sensitive of -D. Move them into config.h. FIXME: It'd be better that they are #cmakedefine01 rather than #cmakedefine. (#if FOO rather than #if defined(FOO)) Then we can find missing #include "clang/Config/config.h" in the future. Differential Revision: https://reviews.llvm.org/D35527 llvm-svn: 308277
* [AArch64] Add support for __builtin_ms_va_list on aarch64Martin Storsjo2017-07-171-1/+1
| | | | | | | | | | | Move builtins from the x86 specific scope into the global scope. Their use is still limited to x86_64 and aarch64 though. This allows wine on aarch64 to properly handle variadic functions. Differential Revision: https://reviews.llvm.org/D34475 llvm-svn: 308218
* [NFC] Refactor the Preprocessor function that handles Macro definitions and ↵Faisal Vali2017-07-171-1/+1
| | | | | | | | | | | | | | | | | rename Arguments to Parameters in Macro Definitions. - Extracted the reading of the tokens out into a separate function. - Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation). This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible. I will also directly update some extra clang tooling that is broken by the change from Argument to Parameter. Hopefully the bots will stay appeased. Thanks! llvm-svn: 308190
* Revert changes from my previous refactoring - will need to fix dependencies ↵Faisal Vali2017-07-171-1/+1
| | | | | | | | in clang's extra tooling (such as clang-tidy etc.). Sorry about that. llvm-svn: 308158
* [NFC] Refactor the Preprocessor function that handles Macro definitions and ↵Faisal Vali2017-07-171-1/+1
| | | | | | | | | | | | | | rename Arguments to Parameters in Macro Definitions. - Extracted the reading of the tokens out into a separate function. - Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation). This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible. Thanks! llvm-svn: 308157
* do more processing in clang-fuzzer (use EmitAssemblyAction)Kostya Serebryany2017-07-142-3/+11
| | | | | | | | | | | | | | Summary: use EmitAssemblyAction in clang-fuzzer Reviewers: klimek, rsmith Reviewed By: klimek Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D34267 llvm-svn: 308045
* [diagtool] Add a 'find-diagnostic-id' subcommand that converts a name ofAlex Lorenz2017-07-122-0/+59
| | | | | | | | | | | the diagnostic to its enum value This will be used by a script that invokes clang in a debugger and forces it to stop when it reports a particular diagnostic. Differential Revision: https://reviews.llvm.org/D35306 llvm-svn: 307813
* [libclang] Support for querying whether an enum is scopedAlex Lorenz2017-07-123-0/+12
| | | | | | | | | | | This commit allows checking whether an enum declaration is scoped through libclang and clang.cindex (Python). Patch by Johann Klähn! Differential Revision: https://reviews.llvm.org/D35187 llvm-svn: 307771
* Revert r307769 (Forgot to mention the name of the contributor).Alex Lorenz2017-07-123-12/+0
| | | | llvm-svn: 307770
* [libclang] Support for querying whether an enum is scopedAlex Lorenz2017-07-123-0/+12
| | | | | | | | | This commit allows checking whether an enum declaration is scoped through libclang and clang.cindex (Python). Differential Revision: https://reviews.llvm.org/D35187 llvm-svn: 307769
* [clang-import-test] Committed missed update to clang-import-test.cppSean Callanan2017-07-111-16/+2
| | | | | | | | | I didn't commit clang-import-test.cpp in r307600, but it had some changes that were part of https://reviews.llvm.org/D35220 Corrected that now. llvm-svn: 307602
OpenPOWER on IntegriCloud