summaryrefslogtreecommitdiffstats
path: root/include/clang
Commit message (Collapse)AuthorAgeFilesLines
* Add CoreOption flag to "-coverage" option to make it available for clang-clMarco Castelluccio2017-11-081-1/+1
| | | | | | | | | | | | | | | | Summary: The -coverage option is not a CoreOption, so it is not available to clang-cl. This patch adds the CoreOption flag to "-coverage" to allow it to be used with clang-cl. Reviewers: rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38221 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317709 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved QualTypeNames.h from Tooling to AST.Ilya Biryukov2017-11-081-7/+18
| | | | | | | | | | | | | | | | | Summary: For code reuse in SemaCodeComplete. Note that the tests for QualTypeNames are still in Tooling as they use Tooling's common testing code. Reviewers: rsmith, saugustine, rnk, klimek, bkramer Reviewed By: rnk Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D39224 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317676 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-refactor] Introduce a new rename rule for qualified symbolsHaojian Wu2017-11-081-0/+22
| | | | | | | | | | | | | | Summary: Prototype of a new rename rule for renaming qualified symbol. Reviewers: arphaman, ioeric, sammccall Reviewed By: arphaman, sammccall Subscribers: jklaehn, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D39332 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317672 91177308-0d34-0410-b5e6-96231b3b80d8
* [Serialization] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-11-081-136/+184
| | | | | | warnings; other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317648 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-083-176/+264
| | | | | | minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317644 91177308-0d34-0410-b5e6-96231b3b80d8
* [NVPTX] Implement __nvvm_atom_add_gen_d builtin.Justin Lebar2017-11-071-1/+1
| | | | | | | | | | | | | | | Summary: This just seems to have been an oversight. We already supported the f64 atomic add with an explicit scope (e.g. "cta"), but not the scopeless version. Reviewers: tra Subscribers: jholewinski, sanjoy, cfe-commits, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D39638 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317623 91177308-0d34-0410-b5e6-96231b3b80d8
* New clang option -fno-plt which avoids the PLT and lazy binding while making ↵Sriraman Tallam2017-11-072-0/+6
| | | | | | | | external calls. Differential Revision: https://reviews.llvm.org/D39079 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317605 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor] rename field references in __builtin_offsetofAlex Lorenz2017-11-071-0/+12
| | | | | | | rdar://33875453 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317599 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] [NFC] Remove unused typedef from SVals.hGeorge Karpenkov2017-11-071-3/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D39620 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317537 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify the error message for unsupported aliases on DarwinAlex Lorenz2017-11-071-1/+1
| | | | | | | rdar://35109556 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317532 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Replace the mask cmpeq/cmple/cmplt/cmpgt/cmpge/cmpneq intrinsics with ↵Craig Topper2017-11-061-30/+1
| | | | | | | | macros that just pass the right comparison predicate value to the regular cmp intrinsic. Remove mask cmpeq/cmpgt builtins that are now unused. This shortens the intrinsic headers a little and allows us to get rid of the cmpeq and cmpgt handling from CGBuiltin.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317506 91177308-0d34-0410-b5e6-96231b3b80d8
* lowering broadcastmJina Nahias2017-11-061-6/+0
| | | | | | Change-Id: I0661abea3e3742860e0a03ff9e4fcdc367eff7db git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317456 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief from doxygen comments in PrettyPrinter.hAdrian Prantl2017-11-051-39/+37
| | | | | | | | Patch by @xsga! Differential Revision: https://reviews.llvm.org/D39633 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317443 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] add remquo to list of recognized library callsSanjay Patel2017-11-041-0/+4
| | | | | | | | | | | | | This is just an oversight because we already do recognize __builtin_remquo() with the same signature. http://en.cppreference.com/w/c/numeric/math/remquo http://pubs.opengroup.org/onlinepubs/9699919799/functions/remquo.html Differential Revision: https://reviews.llvm.org/D39615 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317407 91177308-0d34-0410-b5e6-96231b3b80d8
* [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-11-034-113/+126
| | | | | | other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317381 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][extract] insert semicolons into extracted/inserted codeAlex Lorenz2017-11-031-0/+7
| | | | | | | | | | | | | | | | | | | when needed This commit implements the semicolon insertion logic into the extract refactoring. The following rules are used: - extracting expression: add terminating ';' to the extracted function. - extracting statements that don't require terminating ';' (e.g. switch): add terminating ';' to the callee. - extracting statements with ';': move (if possible) the original ';' from the callee and add terminating ';'. - otherwise, add ';' to both places. Differential Revision: https://reviews.llvm.org/D39441 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317343 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Add Scudo as a possible -fsanitize= optionKostya Kortchinsky2017-11-032-0/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: This change adds Scudo as a possible Sanitizer option via -fsanitize=. This allows for easier static & shared linking of the Scudo library, it allows us to enforce PIE (otherwise the security of the allocator is moot), and check for incompatible Sanitizers combo. In its current form, Scudo is not compatible with any other Sanitizer, but the plan is to make it work in conjunction with UBsan (-fsanitize=scudo,undefined), which will require additional work outside of the scope of this change. Reviewers: eugenis, kcc, alekseyshl Reviewed By: eugenis, alekseyshl Subscribers: llvm-commits, srhines Differential Revision: https://reviews.llvm.org/D39334 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317337 91177308-0d34-0410-b5e6-96231b3b80d8
* [Tooling] Put createExecutorFromCommandLineArgs implementation in a wrapper. NFCEric Liu2017-11-031-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317328 91177308-0d34-0410-b5e6-96231b3b80d8
* [preamble] Also record the "skipping" state of the preprocessorErik Verbruggen2017-11-031-2/+31
| | | | | | | | | | | When a preamble ends in a conditional preprocessor block that is being skipped, the preprocessor needs to continue skipping that block when the preamble is used. This fixes PR34570. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317308 91177308-0d34-0410-b5e6-96231b3b80d8
* [Serialization] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-11-022-62/+383
| | | | | | warnings; other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317273 91177308-0d34-0410-b5e6-96231b3b80d8
* Add default calling convention support for regcall.Erich Keane2017-11-023-2/+5
| | | | | | | | | | | | Added support for regcall as default calling convention. Also added code to exclude main when applying default calling conventions. Patch-By: eandrews Differential Revision: https://reviews.llvm.org/D39210 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317268 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] fix const-ness of builtin equivalents of <math.h> and <complex.h> ↵Sanjay Patel2017-11-021-129/+129
| | | | | | | | | | | | | | | | | functions that might set errno This just makes const-ness of the builtins match const-ness of their lib function siblings. We're deferring fixing some of these that are obviously wrong to follow-up patches. Hopefully, the bugs are visible in the new test file (added at rL317220). As the description in Builtins.def says: "e = const, but only when -fmath-errno=0". This is step 2 of N to fix builtins and math calls as discussed in D39204. Differential Revision: https://reviews.llvm.org/D39481 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317265 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r317228: remove unused function from ObjCRuntime.h, NFCAlex Lorenz2017-11-021-0/+5
| | | | | | | This function is actually used in LLDB git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317231 91177308-0d34-0410-b5e6-96231b3b80d8
* remove unused function from ObjCRuntime.h, NFCAlex Lorenz2017-11-021-5/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317228 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in class annotationJan Korous2017-11-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317200 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTMatchers] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-11-014-97/+165
| | | | | | warnings; other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317137 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix warnings discovered by rL317076. [-Wunused-private-field]NAKAMURA Takumi2017-11-011-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317091 91177308-0d34-0410-b5e6-96231b3b80d8
* Reformat.NAKAMURA Takumi2017-11-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317089 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Removing unused stored field.George Karpenkov2017-11-011-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317070 91177308-0d34-0410-b5e6-96231b3b80d8
* [Analyzer] Use value storage for BodyFarmGeorge Karpenkov2017-11-012-4/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D39428 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317065 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][extract] prohibit extraction of ObjC property settersAlex Lorenz2017-11-011-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317056 91177308-0d34-0410-b5e6-96231b3b80d8
* [CFI] Add CFI-icall pointer type generalizationVlad Tsyrklevich2017-10-313-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows generalizing pointers in type signatures used for cfi-icall by enabling the -fsanitize-cfi-icall-generalize-pointers flag. This works by 1) emitting an additional generalized type signature metadata node for functions and 2) llvm.type.test()ing for the generalized type for translation units with the flag specified. This flag is incompatible with -fsanitize-cfi-cross-dso because it would require emitting twice as many type hashes which would increase artifact size. Reviewers: pcc, eugenis Reviewed By: pcc Subscribers: kcc Differential Revision: https://reviews.llvm.org/D39358 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317044 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix usage of right shift operator in fold expressionsRichard Smith2017-10-311-0/+6
| | | | | | | | | The right shift operator was not seen as a valid operator in a fold expression, which is PR32563. Patch by Nicolas Lesser ("Blitz Rakete")! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317032 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Use the same filename for the header and the implementation of ↵George Karpenkov2017-10-302-4/+4
| | | | | | | | BugReporterVisitor Differential Revision: https://reviews.llvm.org/D37935 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316963 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-format] Format raw string literalsKrasimir Georgiev2017-10-301-0/+36
| | | | | | | | | | | | | | | Summary: This patch adds raw string literal formatting. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: klimek, mgorny Differential Revision: https://reviews.llvm.org/D35943 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316903 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Make issue hash related tests more conciseGabor Horvath2017-10-301-4/+0
| | | | | | | | | | | Extend ExprInspection checker to make it possible to dump the issue hash of arbitrary expressions. This change makes it possible to make issue hash related tests more concise and also makes debugging issue hash related problems easier. Differential Revision: https://reviews.llvm.org/D38844 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316899 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS] Allow access to ambiguous, inaccessible direct basesReid Kleckner2017-10-272-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Clang typically warns that in the following class hierarchy, 'A' is inaccessible because there is no series of casts that the user can write to access it unambiguously: struct A { }; struct B : A { }; struct C : A, B { }; MSVC allows the user to convert from C* to A*, though, and we've encountered this issue in the latest Windows SDK headers. This patch allows this conversion when -fms-compatibility is set and adds a warning for it under -Wmicrosoft-inaccessible-base. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39389 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316807 91177308-0d34-0410-b5e6-96231b3b80d8
* StaticAnalyzer: Modularize/fix ODR violations making functions inline but ↵David Blaikie2017-10-274-21/+16
| | | | | | | | | non-static in headers Also move these out of the llvm namespace & rely on ADL as is appropriate for these op<< overloads. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316794 91177308-0d34-0410-b5e6-96231b3b80d8
* Sanitizers.h: Modularize/Fix ODR violations by making inline functions ↵David Blaikie2017-10-271-1/+1
| | | | | | non-static git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316793 91177308-0d34-0410-b5e6-96231b3b80d8
* CharInfo.h: Modularize/fix ODR violations by making inline functions in ↵David Blaikie2017-10-271-21/+21
| | | | | | header not static git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316792 91177308-0d34-0410-b5e6-96231b3b80d8
* ASTContext.h: Modularize/fix ODR violations by removing 'static' from inline ↵David Blaikie2017-10-271-2/+2
| | | | | | functions in headers git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316791 91177308-0d34-0410-b5e6-96231b3b80d8
* Filter out invalid 'target' items from being passed to LLVMErich Keane2017-10-271-2/+2
| | | | | | | | | | | | | | | | | | | Craig noticed that CodeGen wasn't properly ignoring the values sent to the target attribute. This patch ignores them. This patch also sets the 'default' for this checking to 'supported', since only X86 has implemented the support for checking valid CPU names and Feature Names. One test was changed to i686, since it uses a lakemont, which would otherwise be prohibited in x86_64. Differential Revision: https://reviews.llvm.org/D39357 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316783 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor] Describe refactorings in the operation classesAlex Lorenz2017-10-276-17/+89
| | | | | | | | | | | | | | | | | | This commit changes the way that the refactoring operation classes are structured: - Users have to call `initiate` instead of constructing an instance of the class. The `initiate` is now supposed to have custom initiation logic, and you don't need to subclass the builtin requirements. - A new `describe` function returns a structure with the id, title and the description of the refactoring operation. The refactoring action classes are now placed into one common place in RefactoringActions.cpp instead of being separate. Differential Revision: https://reviews.llvm.org/D38985 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316780 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86][Driver] Move all of the X86 feature flags to one spot in the ↵Craig Topper2017-10-261-121/+125
| | | | | | | | | | | | | | Options.td file and pair them up with their negations. It looks like at one time Options.td was in alphabetical order, but that looks to have long been broken. The result is that it all the no- x86 options got separated from their other friends for no good reason. This patch puts them all together in one place with the no- paired with its none negated version. I've kept all the SSE and AVX/AVX512 bits together since they represent a somewhat linear progression of features. The rest I just put in alphabetical order after. Differential Revision: https://reviews.llvm.org/D39341 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316705 91177308-0d34-0410-b5e6-96231b3b80d8
* Add objcCategoryImplDecl matcherDave Lee2017-10-261-0/+11
| | | | | | | | | | | | | | | | | Summary: Add `objcCategoryImplDecl` which matches ObjC category definitions (`@implementation`). This matcher complements `objcCategoryDecl` (`@interface`) which was added in D30854. Reviewers: aaron.ballman, malcolm.parsons, alexshap Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D39293 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316670 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new attribute definition spelling, Clang<"attr">, that expands to two ↵Aaron Ballman2017-10-261-67/+43
| | | | | | | | | | attribute spellings: GNU<"attr"> and CXX11<"clang", "attr">. This is similar to how the GCC spelling works and is intended to be used for attributes introduced for Clang. Changes all existing attributes that currently use GNU<"attr"> and CXX11<"clang", "attr> spellings to instead use the Clang<"attr"> spelling. No additional tests are necessary because the existing tests already use both spellings for the attributes converted to the new spelling. No functional changes are expected. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316658 91177308-0d34-0410-b5e6-96231b3b80d8
* [Tooling] A new framework for executing clang frontend actions.Eric Liu2017-10-265-2/+298
| | | | | | | | | | | | | | | | | | | | | | | Summary: This defines a `clang::tooling::ToolExecutor` interface that can be extended to support different execution plans including standalone execution on a given set of TUs or parallel execution on all TUs in a codebase. In order to enable multiprocessing execution, tool actions are expected to output result into a `ToolResults` interface provided by executors. The `ToolResults` interface abstracts how results are stored e.g. in-memory for standalone executions or on-disk for large-scale execution. New executors can be registered as `ToolExecutorPlugin`s via the `ToolExecutorPluginRegistry`. CLI tools can use `createExecutorFromCommandLineArgs` to create a specific registered executor according to the command-line arguments. This patch also implements `StandaloneToolExecutor` which has the same behavior as the current `ClangTool` interface, i.e. execute frontend actions on a given set of TUs. At this point, it's simply a wrapper around `ClangTool` at this point. This is still experimental but expected to replace the existing `ClangTool` interface so that specific tools would not need to worry about execution. Reviewers: klimek, arphaman, hokein, sammccall Reviewed By: klimek Subscribers: cfe-commits, djasper, mgorny, omtcyfz Differential Revision: https://reviews.llvm.org/D34272 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316653 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix overloaded static functions in SemaCodeCompleteBenjamin Kramer2017-10-261-1/+2
| | | | | | | | | | | | | | | | | | | | | https://bugs.llvm.org/show_bug.cgi?id=33904 Happens when static function is accessed via the class variable. That leads to incorrect overloads number because the variable is considered as the first argument. struct Bar { static void foo(); static void foo(int); }; int main() { Bar b; b.foo(/*complete here*/); // did not work before Bar::foo(/*complete here*/); // worked fine } Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D36390 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316646 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow StmtPrinter to supress implicit 'this' and 'self' base expressionsAlex Lorenz2017-10-261-2/+5
| | | | | | | | | This will be useful for certain refactoring actions. rdar://34202062 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316631 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle PragmaDebug in PPChainedCallbacksAlex Lorenz2017-10-251-0/+5
| | | | | | | The test is in clang-tools-extra/test/pp-trace git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316621 91177308-0d34-0410-b5e6-96231b3b80d8