summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix clang -Wimplicit-fallthrough warnings across llvm, NFCReid Kleckner2018-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch should not introduce any behavior changes. It consists of mostly one of two changes: 1. Replacing fall through comments with the LLVM_FALLTHROUGH macro 2. Inserting 'break' before falling through into a case block consisting of only 'break'. We were already using this warning with GCC, but its warning behaves slightly differently. In this patch, the following differences are relevant: 1. GCC recognizes comments that say "fall through" as annotations, clang doesn't 2. GCC doesn't warn on "case N: foo(); default: break;", clang does 3. GCC doesn't warn when the case contains a switch, but falls through the outer case. I will enable the warning separately in a follow-up patch so that it can be cleanly reverted if necessary. Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu Differential Revision: https://reviews.llvm.org/D53950 llvm-svn: 345882
* Create ConstantExpr classBill Wendling2018-10-311-0/+4
| | | | | | | | | | | | | | | | A ConstantExpr class represents a full expression that's in a context where a constant expression is required. This class reflects the path the evaluator took to reach the expression rather than the syntactic context in which the expression occurs. In the future, the class will be expanded to cache the result of the evaluated expression so that it's not needlessly re-evaluated Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D53475 llvm-svn: 345692
* NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)Erik Pilkington2018-10-303-5/+4
| | | | | | | | | | We haven't supported compiling ObjC1 for a long time (and never will again), so there isn't any reason to keep these separate. This patch replaces LangOpts::ObjC1 and LangOpts::ObjC2 with LangOpts::ObjC. Differential revision: https://reviews.llvm.org/D53547 llvm-svn: 345637
* [clang] Introduce new completion context typesKadir Cetinkaya2018-10-241-2/+3
| | | | | | | | | | | | | | Summary: New name suggestions were being used in places where existing names should have been used, this patch tries to fix some of those situations. Reviewers: sammccall Reviewed By: sammccall Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53191 llvm-svn: 345152
* Add support for 'dynamic_allocators' clause on 'requires' directive. ↵Patrick Lyster2018-10-111-0/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D53079 llvm-svn: 344249
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-103-9/+9
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140
* [Driver][cc1][cc1as] Call OptTable::PrintHelp with explicit " [options] file..."Fangrui Song2018-10-101-1/+2
| | | | | | | | | | | | | | Summary: This is to accommodate a change in llvm/lib/Option/OptTable.cpp D51009 Reviewers: rupprecht, alexshap, jhenderson Reviewed By: rupprecht Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51109 llvm-svn: 344098
* [OPENMP] Add reverse_offload clause to requires directivePatrick Lyster2018-10-031-0/+3
| | | | llvm-svn: 343711
* Add support for unified_shared_memory clause on requires directivePatrick Lyster2018-10-011-0/+3
| | | | llvm-svn: 343472
* llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song2018-09-262-4/+4
| | | | | | | | | | | | | | Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: rsmith, #clang, dblaikie Reviewed By: rsmith, #clang Subscribers: mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52576 llvm-svn: 343147
* [analyzer] scan-build: if --status-bugs is passed, don't forget about the ↵Roman Lebedev2018-09-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | exit status of the actual build Summary: This has been bothering me for a while, but only now i have actually looked into this. I'm using one CI job for static analysis - clang static analyzers as compilers + clang-tidy via cmake. And i'd like for the build to fail if at least one of those finds issues. If clang-tidy finds issues, it will fail the build since the warnings-as-errors is set. If static analyzer finds anything, since --status-bugs is set, it will fail the build. But if clang-tidy find anything, but static analyzer does not, the build succeeds :/ Reviewers: sylvestre.ledru, alexfh, jroelofs, ygribov, george.karpenkov, krememek Reviewed By: jroelofs Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D52530 llvm-svn: 343105
* [OPENMP] Add support for OMP5 requires directive + unified_address clauseKelvin Li2018-09-261-0/+4
| | | | | | | | | Add support for OMP5.0 requires directive and unified_address clause. Patches to follow will include support for additional clauses. Differential Revision: https://reviews.llvm.org/D52359 llvm-svn: 343063
* [index] Enhance indexing for module referencesArgyrios Kyrtzidis2018-09-183-5/+16
| | | | | | | * Create a USR for the occurrences of the 'module' symbol kind * Record module references for each identifier in an import declaration llvm-svn: 342484
* [CodeComplete] Add completions for filenames in #include directives.Sam McCall2018-09-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The dir component ("somedir" in #include <somedir/fo...>) is considered fixed. We append "foo" to each directory on the include path, and then list its files. Completions are of the forms: #include <somedir/fo^ foo.h> fox/ The filter is set to the filename part ("fo"), so fuzzy matching can be applied to the filename only. No fancy scoring/priorities are set, and no information is added to CodeCompleteResult to make smart scoring possible. Could be in future. Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52076 llvm-svn: 342449
* scan-build: Add support of the option --exclude like in scan-build-pySylvestre Ledru2018-09-171-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To exclude thirdparty code. To test: With /tmp/foo.c ``` void test() { int x; x = 1; // warn } ``` ``` $ scan-build --exclude non-existing/ --exclude /tmp/ -v gcc -c foo.c scan-build: Using '/usr/lib/llvm-7/bin/clang' for static analysis scan-build: Emitting reports for this run to '/tmp/scan-build-2018-09-16-214531-8410-1'. foo.c:3:3: warning: Value stored to 'x' is never read x = 1; // warn ^ ~ 1 warning generated. scan-build: File '/tmp/foo.c' deleted: part of an ignored directory. scan-build: 0 bugs found. ``` Reviewers: jroelofs Reviewed By: jroelofs Subscribers: whisperity, cfe-commits Differential Revision: https://reviews.llvm.org/D52153 llvm-svn: 342359
* scan-build: remove trailing whitespacesSylvestre Ledru2018-09-161-4/+4
| | | | llvm-svn: 342351
* Also manages clang-X as tool for scan-buildSylvestre Ledru2018-09-161-1/+1
| | | | | | | | | | | | | | Summary: This will make scan-build-7 clang-7 -c foo.c &> /dev/null Reviewers: jroelofs Subscribers: kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52151 llvm-svn: 342350
* clang-check: rename the local FixItActionSaleem Abdulrasool2018-09-101-2/+2
| | | | | | | | | | | Resolve the ambiguity in the FixItAction definition by renaming the type. With Xcode 9.2, you would fail to build this with: llvm/tools/clang/tools/clang-check/ClangCheck.cpp:183:48: error: reference to 'FixItAction' is ambiguous FrontendFactory = newFrontendActionFactory<FixItAction>(); ^ llvm-svn: 341877
* [libclang] Return the proper pointee type for 'auto' deduced to pointerIvan Donchevskii2018-09-071-0/+7
| | | | | | | | Currently the resulting type is always invalid in such case. Differential Revision: https://reviews.llvm.org/D51281 llvm-svn: 341656
* [analyzer] Remove traces of ubigraph visualizationGeorge Karpenkov2018-09-062-7/+0
| | | | | | | | | | Ubigraph project has been dead since about 2008, and to the best of my knowledge, no one was using it. Previously, I wasn't able to launch the existing binary at all. Differential Revision: https://reviews.llvm.org/D51655 llvm-svn: 341601
* [Sema] Store MacroInfo in CodeCompletionResult for macro results.Eric Liu2018-09-051-9/+9
| | | | | | | | | | | | | | Summary: This provides information about the macro definition. For example, it can be used to compute macro USRs. Reviewers: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51675 llvm-svn: 341476
* [CodeComplete] Report location of opening parens for signature helpIlya Biryukov2018-08-301-1/+2
| | | | | | | | | | | | | | Summary: Used in clangd. Reviewers: sammccall Reviewed By: sammccall Subscribers: ioeric, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51436 llvm-svn: 341063
* [libclang] Fix cursors for arguments of Subscript and Call operatorsIvan Donchevskii2018-08-231-1/+131
| | | | | | | | | | | | | | | | | | The DeclRefExpr of CXXOperatorCallExpr refering to the custom operator is visited before the arguments to the operator call. For the Call and Subscript operator the range of this DeclRefExpr includes the whole call expression, so that all tokens in that range were mapped to the operator function, even the tokens of the arguments. Fix this by ensuring that this particular DeclRefExpr is visited last. Fixes PR25775. Fix by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D40481 llvm-svn: 340521
* win: Omit ".exe" from clang and clang-cl driver-level diagnostics.Nico Weber2018-08-221-3/+3
| | | | | | | Like https://reviews.llvm.org/D51133 but for clang. https://reviews.llvm.org/D51134 llvm-svn: 340498
* libclang: add install/distribution targets for pythonSaleem Abdulrasool2018-08-201-0/+19
| | | | | | | | | | | Add installation support for the python bindings for libclang. Add an additional CMake configuration variable to enumerate the python versions for which the bindings should be installed. This allows for a LLVM/clang distribution to distribute the python bindings for libclang as part of the image. Because the python versions need to be explicitly stated by the user, the default image remains unchanged. llvm-svn: 340228
* [ASTImporter] Add test for C++'s try/catch statements.Raphael Isemann2018-08-201-0/+2
| | | | | | | | | | | | | | Summary: Also enable exceptions in clang-import-test so that we can parse the test files. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50978 llvm-svn: 340220
* [ASTImporter] Add test for C++ casts and fix broken const_cast importing.Raphael Isemann2018-08-201-0/+2
| | | | | | | | | | | | | | | | Summary: The ASTImporter does currently not handle const_casts. This patch adds the missing const_cast importer code and the test case that discovered this. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50932 llvm-svn: 340182
* Update README and Dockerfile to include llvm-proto-fuzzerEmmett Neyman2018-08-162-0/+38
| | | | | | | | | | | | | | Summary: Added commands to Dockerfile to build llvm-proto-fuzzer and the other related tools. Also added a section to the bottom of the README describing what llvm-proto-fuzzer does and how to run it. Reviewers: morehouse, kcc Reviewed By: morehouse Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D50829 llvm-svn: 339933
* Implementation of nested loops in cxx_loop_protoEmmett Neyman2018-08-153-35/+116
| | | | | | | | | | | | | | Summary: Extended `cxx_loop_proto` to have neste for loops. Modified `loop_proto_to_llvm` and `loop_proto_to_cxx` to handle the new protos. All protos have a set of statements designated as "inner loop" statements and a set of statements designated as "outer loop" statements. Reviewers: morehouse, kcc Reviewed By: morehouse Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D50670 llvm-svn: 339832
* Added LLVM metadata to generated IR to increase vectorization widthEmmett Neyman2018-08-091-1/+6
| | | | | | | | | | | | | | Summary: Edited `loop_proto_to_llvm` to emit metadata at the end of the generated IR. This metadata will increase the vector width when the IR is optimized. Reviewers: morehouse, kcc Reviewed By: morehouse Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D50530 llvm-svn: 339392
* Port getLocEnd -> getEndLocStephen Kelly2018-08-091-2/+2
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50351 llvm-svn: 339386
* Port getLocStart -> getBeginLocStephen Kelly2018-08-093-22/+22
| | | | | | | | | | Reviewers: teemperor! Subscribers: jholewinski, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50350 llvm-svn: 339385
* Added another optimization pass to make vectorizing possibleEmmett Neyman2018-08-091-4/+16
| | | | | | | | | | | | | | Summary: I noticed that my code wasn't going deep into the loop vectorizer code so added another pass that makes it go further. Reviewers: morehouse, kcc Reviewed By: morehouse Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D50482 llvm-svn: 339305
* Changed how LLVM IR was generated to increase vectorizationEmmett Neyman2018-08-061-14/+13
| | | | | | | | | | | | | | Summary: Changed the structure of the generated IR to make it easier to vectorize Reviewers: morehouse, kcc Reviewed By: morehouse Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D50342 llvm-svn: 339080
* [clang-rename] make clang-rename.py vim integration python3 compatibleJonas Toth2018-08-061-4/+9
| | | | | | | | | | | | | | | | | Summary: This patch makes the clang-rename.py script useable for vim with only python3 support. It uses the print-function and adjust the doc slightly to mention the correct python3 command for the letter mapping in vim. Reviewers: arphaman, klimek, aaron.ballman, hokein Reviewed By: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50307 llvm-svn: 338996
* [clang-fuzzer] Remove unused typedef.Matt Morehouse2018-08-041-2/+1
| | | | llvm-svn: 338946
* LLVM Proto Fuzzer - Run Functions on Suite of InputsEmmett Neyman2018-08-043-15/+149
| | | | | | | | | | | | | | | | Summary: Added corpus of arrays to use as inputs for the functions. Check that the two functions modify the inputted arrays in the same way. Reviewers: kcc, morehouse Reviewed By: morehouse Subscribers: mgorny, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D50194 llvm-svn: 338943
* clang-format-diff: Make it work with python3 tooKrasimir Georgiev2018-08-031-10/+15
| | | | | | | | | | | | | | | | Summary: It is not necessary, but would be nice if the script run on python3 as well (as opposed to only python2, which is going to be deprecated https://pythonclock.org/) Contributed by MarcoFalke! Reviewers: krasimir Reviewed By: krasimir Subscribers: lebedev.ri, sammccall, cfe-commits Differential Revision: https://reviews.llvm.org/D48098 llvm-svn: 338839
* [libclang 8/8] Add support for the flag_enum attributeMichael Wu2018-08-032-0/+3
| | | | | | | | | | | | | | | | | Summary: This adds support to libclang for reading the flag_enum attribute. This also bumps CINDEX_VERSION_MINOR for this patch series. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49635 llvm-svn: 338820
* [libclang 7/8] Add support for getting property setter and getter namesMichael Wu2018-08-033-0/+54
| | | | | | | | | | | | | | Summary: This allows libclang to access the actual names of property setters and getters without needing to go through the indexer API. Usually default names are used, but the property can specify a different name. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49634 llvm-svn: 338816
* [libclang 6/8] Add support for reading implicit attributesMichael Wu2018-08-032-1/+25
| | | | | | | | | | | | | | | | | Summary: Having access to implicit attributes is sometimes useful so users of libclang don't have to duplicate some of the logic in sema. This depends on D49081 since it also adds a CXTranslationUnit flag. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49631 llvm-svn: 338815
* [libclang 5/8] Add support for ObjC attributes without argsMichael Wu2018-08-032-0/+51
| | | | | | | | | | | | | | | | | Summary: This adds support to libclang for identifying ObjC related attributes that don't take arguments. All attributes but NSObject and NSConsumed are tested. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49127 llvm-svn: 338813
* [libclang 4/8] Add the clang_Type_getNullability() APIMichael Wu2018-08-033-0/+48
| | | | | | | | | | | | | | | | | Summary: This patch adds a clang-c API for querying the nullability of an AttributedType. The test here also tests D49081 Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49082 llvm-svn: 338809
* [libclang 3/8] Add support for AttributedTypeMichael Wu2018-08-032-1/+17
| | | | | | | | | | | | | | | | | | | Summary: This patch adds support to the libclang API for identifying AttributedTypes in CXTypes and reading the modified type that the type points to. Currently AttributedTypes are skipped. This patch continues to skip AttributedTypes by default, but adds a parsing option to CXTranslationUnit to include AttributedTypes. This patch depends on D49066 since it also adds a CXType. Testing will be added in another patch which depends on this one. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49081 llvm-svn: 338808
* [libclang 2/8] Add support for ObjCTypeParamMichael Wu2018-08-031-0/+2
| | | | | | | | | | | | | | | | | Summary: This patch adds support to the libclang API for identifying ObjCTypeParams in CXTypes. This patch depends on D49063 since both patches add new values to CXTypeKind. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49066 llvm-svn: 338807
* [libclang 1/8] Add support for ObjCObjectTypeMichael Wu2018-08-033-1/+111
| | | | | | | | | | | | | | Summary: This patch adds support to the clang-c API for identifying ObjCObjects in CXTypes, enumerating type args and protocols on ObjCObjectTypes, and retrieving the base type of ObjCObjectTypes. Currently only ObjCInterfaceTypes are exposed, which do not have type args or protocols. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49063 llvm-svn: 338804
* [c-index-test] Use correct executable path to discover resource directory.Volodymyr Sapsai2018-08-021-5/+10
| | | | | | | | | | | | | | | | | Driver builds resource directory path based on provided executable path. Instead of string "clang" use actual executable path. rdar://problem/42699514 Reviewers: nathawes, akyrtzi, bob.wilson Reviewed By: akyrtzi Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50160 llvm-svn: 338741
* [NFC] Silence warning about ptr-to-func to ptr-to-obj cast in ↵Andrei Elovikov2018-08-011-1/+17
| | | | | | | | | | | | | | | | | | | | | clang-fuzzer/handle-llvm/handle_llvm.cpp. Summary: I don't have the whole list of GCC binaries available so I determined the exact version where the warning disappeared via: https://github.com/gcc-mirror/gcc/blob/gcc-4_9_0-release/gcc/cp/typeck.c#L6863 https://github.com/gcc-mirror/gcc/blob/gcc-4_8_5-release/gcc/cp/typeck.c#L6652 Reviewers: emmettneyman, erichkeane Reviewed By: emmettneyman, erichkeane Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50056 llvm-svn: 338551
* added shared library to fix buildbotEmmett Neyman2018-07-271-0/+2
| | | | | | | | | | Summary: added shared library to fix buildbot Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D49895 llvm-svn: 338091
* Updated llvm-proto-fuzzer to execute the compiled codeEmmett Neyman2018-07-263-58/+148
| | | | | | | | | | | | | | | | | | Summary: Made changes to the llvm-proto-fuzzer - Added loop vectorizer optimization pass in order to have two IR versions - Updated old fuzz target to handle two different IR versions - Wrote code to execute both versions in memory Reviewers: morehouse, kcc, alexshap Reviewed By: morehouse Subscribers: pcc, mgorny, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D49526 llvm-svn: 338077
OpenPOWER on IntegriCloud