summaryrefslogtreecommitdiffstats
path: root/clang/include
Commit message (Collapse)AuthorAgeFilesLines
* [CUDA] Detect and link with CUDA's libdevice bitcode library.Artem Belevich2015-11-171-0/+1
| | | | | | | | | | | - added detection of libdevice bitcode file and API to find one appropriate for the GPU we're compiling for. - pass additional cc1 options for linking with detected libdevice bitcode - added -nocudalib to prevent automatic linking with libdevice - added test cases to verify new functionality Differential Revision: http://reviews.llvm.org/D14556 llvm-svn: 253387
* [CUDA] added include paths for both sides of CUDA compilation.Artem Belevich2015-11-172-0/+5
| | | | | | | | | | | | | | | | | | | | | In order to compile a CUDA file clang must be able to find include files for both both host and device. This patch passes AuxToolchain to AddPreprocessingOptions and uses it to add include paths for the opposite side of compilation. We also must be able to find CUDA include files. If the driver found CUDA installation, it adds appropriate include path to CUDA headers. This can be disabled with '-nocudainc'. - Added include paths for the opposite side of compilation. - Added include paths to detected CUDA installation. - Added -nocudainc to prevent adding CUDA include path. - Added test cases to verify new functionality. Differential Revision: http://reviews.llvm.org/D13170 llvm-svn: 253386
* [CUDA] use -aux-triple to pass target triple of opposite side of compilationArtem Belevich2015-11-173-14/+24
| | | | | | | | | | | | | | | | Clang needs to know target triple for both sides of compilation so that preprocessor macros and target builtins from both sides are available. This change augments Compilation class to carry information about toolchains used during different CUDA compilation passes and refactors BuildActions to use it when it constructs CUDA jobs. Removed DeviceTriple from CudaHostAction/CudaDeviceAction as it's no longer needed. Differential Revision: http://reviews.llvm.org/D13144 llvm-svn: 253385
* Add trivial utility to append -L arguments to linker step. NFCDouglas Katzman2015-11-171-0/+4
| | | | llvm-svn: 253350
* Revert "Make FP_CONTRACT ON the default."Manuel Klimek2015-11-171-1/+1
| | | | | | | | | This reverts commit r253269. This leads to assert / segfault triggering on the following reduced example: float foo(float U, float base, float cell) { return (U = 2 * base) - cell; } llvm-svn: 253337
* [Sema] Combine similar diagnostics using %select. NFCCraig Topper2015-11-171-17/+9
| | | | llvm-svn: 253315
* [modules] Fix some more cases where we used to reject a conflict between twoRichard Smith2015-11-171-0/+1
| | | | | | | declarations that are not simultaneously visible, and where at least one of them has internal/no linkage. llvm-svn: 253283
* Make FP_CONTRACT ON the default.Stephen Canon2015-11-161-1/+1
| | | | | | Differential Revision: D14200 llvm-svn: 253269
* clang-format: Enable #include sorting by default.Daniel Jasper2015-11-161-0/+3
| | | | | | | | | This has seen quite some usage and I am not aware of any issues. Also add a style option to enable/disable include sorting. The existing command line flag can from now on be used to override whatever is set in the style. llvm-svn: 253202
* [Basic] Replace vector<bool> with BitVector in SourceManager. NFC.Vedant Kumar2015-11-161-1/+2
| | | | llvm-svn: 253181
* [Basic] Use a bitfield in SLocEntry for clarity. NFC.Vedant Kumar2015-11-161-5/+10
| | | | llvm-svn: 253177
* [Sema] Remove unnecessary includes and forward declarations. NFCCraig Topper2015-11-151-3/+0
| | | | llvm-svn: 253173
* [libclang] Visit TypeAliasTemplateDeclSergey Kalinichev2015-11-151-1/+2
| | | | | | | | This makes TypeAliasTemplateDecl accessible via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13844 llvm-svn: 253166
* [libclang] Expose AutoTypeSergey Kalinichev2015-11-151-1/+2
| | | | | | | | Expose the AutoType via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13000 llvm-svn: 253165
* Fix a layering oddity by passing Sema to DeclSpec::Finish instead of ↵Craig Topper2015-11-151-4/+1
| | | | | | DiagnosticsEngine and Preprocessor. Everything the preprocessor was being used for can be acquired from Sema. llvm-svn: 253158
* [Sema] Don't crash trying to diagnose abs called on a pointer typeDavid Majnemer2015-11-151-0/+3
| | | | | | | | | | | | | | | | | Clang tries to figure out if a call to abs is suspicious by looking through implicit casts to look at the underlying, implicitly converted type. Interestingly, C has implicit conversions from pointer-ish types like function to less exciting types like int. This trips up our 'abs' checker because it doesn't know which variant of 'abs' is appropriate. Instead, diagnose 'abs' called on function types upfront. This sort of thing is highly suspicious and is likely indicative of a missing pointer dereference/function call/array index operation. This fixes PR25532. llvm-svn: 253156
* [WebAssembly] Remove the "const" attribute from __builtin_wasm_memory_size.Dan Gohman2015-11-141-1/+3
| | | | llvm-svn: 253146
* Move diagnostics from Parse to Sema to remove Sema's dependency on ↵Craig Topper2015-11-142-52/+59
| | | | | | ParserDiagnostic.h diagnostics. llvm-svn: 253143
* Merge some similar diagnostics using %select.Craig Topper2015-11-141-21/+11
| | | | llvm-svn: 253136
* Add support for the always_inline + target feature diagnostic to printEric Christopher2015-11-141-2/+3
| | | | | | | out the first missing target feature that's required and reword the diagnostic accordingly. llvm-svn: 253121
* Use %select to merge similar diagnostics. NFCCraig Topper2015-11-141-20/+13
| | | | llvm-svn: 253119
* Deduplicate three identical copies of ↵Yaron Keren2015-11-132-33/+25
| | | | | | isExplicitInstantiationOrSpecialization, NFC. llvm-svn: 253046
* [modules] When a declaration has non-trivial visibility, check whether it'sRichard Smith2015-11-131-2/+1
| | | | | | | actually hidden before we check its linkage. This avoids computing the linkage "too early" for an anonymous struct with a typedef name for linkage. llvm-svn: 253012
* [modules] Follow the C++ standard's rule for linkage of enumerators: they haveRichard Smith2015-11-131-1/+2
| | | | | | | | | the linkage of the enumeration. For enumerators of unnamed enumerations, extend the -Wmodules-ambiguous-internal-linkage extension to allow selecting an arbitrary enumerator (but only if they all have the same value, otherwise it's ambiguous). llvm-svn: 253010
* Add support for function attribute 'disable_tail_calls'.Akira Hatanaka2015-11-132-0/+45
| | | | | | | | | | | | | | | | | | | | | | The ``disable_tail_calls`` attribute instructs the backend to not perform tail call optimization inside the marked function. For example, int callee(int); int foo(int a) __attribute__((disable_tail_calls)) { return callee(a); // This call is not tail-call optimized. } Note that this attribute is different from 'not_tail_called', which prevents tail-call optimization to the marked function. rdar://problem/8973573 Differential Revision: http://reviews.llvm.org/D12547 llvm-svn: 252986
* Remove -Wobjc-weak-compat; there isn't a compelling use case for this.John McCall2015-11-121-3/+0
| | | | llvm-svn: 252971
* [modules] Simplify and generalize the existing rule for finding hiddenRichard Smith2015-11-121-25/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | declarations in redeclaration lookup. A declaration is now visible to lookup if: * It is visible (not in a module, or in an imported module), or * We're doing redeclaration lookup and it's externally-visible, or * We're doing typo correction and looking for unimported decls. We now support multiple modules having different internal-linkage or no-linkage definitions of the same name for all entities, not just for functions, variables, and some typedefs. As previously, if multiple such entities are visible, any attempt to use them will result in an ambiguity error. This patch fixes the linkage calculation for a number of entities where we previously didn't need to get it right (using-declarations, namespace aliases, and so on). It also classifies enumerators as always having no linkage, which is a slight deviation from the C++ standard's definition, but not an observable change outside modules (this change is being discussed on the -core reflector currently). This also removes the prior special case for tag lookup, which made some cases of this work, but also led to bizarre, bogus "must use 'struct' to refer to type 'Foo' in this scope" diagnostics in C++. llvm-svn: 252960
* Revert r240335.Richard Smith2015-11-123-8/+1
| | | | | | | | | | | | | | | This failed to solve the problem it was aimed at, and introduced just as many issues as it resolved. Realistically, we need to deal with the possibility that multiple modules might define different internal linkage symbols with the same name, and this isn't a problem unless two such symbols are simultaneously visible. The case where two modules define equivalent internal linkage symbols is handled by r252063: if lookup finds multiple sufficiently-similar entities from different modules, we just pick one of them as an extension (but we keep them separate). llvm-svn: 252957
* Add support for driver option -mno-ms-bitfields.Akira Hatanaka2015-11-121-0/+2
| | | | | | | | This option is used to cancel -mms-bitfields on the command line. rdar://problem/15898553 llvm-svn: 252912
* Use %select to merge two diagnostics that only differ in one word and are ↵Craig Topper2015-11-121-4/+2
| | | | | | emitted in the same place. NFC llvm-svn: 252861
* libclang: add clang_Cursor_getCXXManglingsSaleem Abdulrasool2015-11-121-0/+6
| | | | | | | | | This function permits the mangling of a C++ 'structor. Depending on the ABI and the declaration, the declaration may contain more than one associated symbol for a given declaration. This allows the consumer to retrieve all of the associated symbols for the declaration the cursor points to. llvm-svn: 252853
* libclang: add new StringSet typeSaleem Abdulrasool2015-11-121-0/+10
| | | | | | | This allows the return of a set of CXStrings from libclang. This is setup work for an upcoming change to permit returning multiple mangled symbols. llvm-svn: 252852
* [AttrDocs] Insert blank lines before and after code-block directives.Akira Hatanaka2015-11-121-0/+6
| | | | | | The code snippets were not being displayed. This commit fixes the bug. llvm-svn: 252849
* Provide a frontend based error for always_inline functions that requireEric Christopher2015-11-121-0/+3
| | | | | | | | | | | | | | | target features that the caller function doesn't provide. This matches the existing backend failure to inline functions that don't have matching target features - and diagnoses earlier in the case of always_inline. Fix up a few test cases that were, in fact, invalid if you tried to generate code from the backend with the specified target features and add a couple of tests to illustrate what's going on. This should fix PR25246. llvm-svn: 252834
* Add diagnostics which fall under [dcl.spec.concept]p5Nathan Wilson2015-11-111-0/+2
| | | | | | | | | | | | Summary: Diagnose when a function concept declaration has parameter(s) Reviewers: rsmith, faisalv, aaron.ballman, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D14352 llvm-svn: 252827
* [X86] Add 'pause' builtin that's already in llvm and use it instead of ↵Craig Topper2015-11-111-0/+1
| | | | | | inline assembly to implement _mm_pause. llvm-svn: 252712
* [X86] Change pointer type in AVX2 gather builtins to be the scalar type ↵Craig Topper2015-11-111-17/+17
| | | | | | instead of the vector type. This matches gcc and removes extras casts. llvm-svn: 252697
* Add support for GCC's '__auto_type' extension, per the GCC manual:Richard Smith2015-11-118-21/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | https://gcc.gnu.org/onlinedocs/gcc/Typeof.html Differences from the GCC extension: * __auto_type is also permitted in C++ (but only in places where it could appear in C), allowing its use in headers that might be shared across C and C++, or used from C++98 * __auto_type can be combined with a declarator, as with C++ auto (for instance, "__auto_type *p") * multiple variables can be declared in a single __auto_type declaration, with the C++ semantics (the deduced type must be the same in each case) This patch also adds a missing restriction on applying typeof to a bit-field, which GCC has historically rejected in C (due to lack of clarity as to whether the operand should be promoted). The same restriction also applies to __auto_type in C (in both GCC and Clang). This also fixes PR25449. Patch by Nicholas Allegra! llvm-svn: 252690
* N3922: direct-list-initialization of an auto-typed variable no longer deduces aRichard Smith2015-11-115-21/+46
| | | | | | | | | | | | | | | | | | | std::initializer_list<T> type. Instead, the list must contain a single element and the type is deduced from that. In Clang 3.7, we warned by default on all the cases that would change meaning due to this change. In Clang 3.8, we will support only the new rules -- per the request in N3922, this change is applied as a Defect Report against earlier versions of the C++ standard. This change is not entirely trivial, because for lambda init-captures we previously did not track the difference between direct-list-initialization and copy-list-initialization. The difference was not previously observable, because the two forms of initialization always did the same thing (the elements of the initializer list were always copy-initialized regardless of the initialization style used for the init-capture). llvm-svn: 252688
* Implement __attribute__((internal_linkage)).Evgeniy Stepanov2015-11-104-0/+26
| | | | | | | | | | | | | | The attrubite is applicable to functions and variables and changes the linkage of the subject to internal. This is the same functionality as C-style "static", but applicable to class methods; and the same as anonymouns namespaces, but can apply to individual methods of a class. Following the proposal in http://lists.llvm.org/pipermail/cfe-dev/2015-October/045580.html llvm-svn: 252648
* [Analyzer] Fix comments and formatting. NFC.Sean Eveson2015-11-101-3/+2
| | | | llvm-svn: 252599
* [Driver] Use platform-appropriate profiling libraries for WatchOS, TVOSVedant Kumar2015-11-101-2/+2
| | | | | | | | | | | | | When adding profiling instrumentation, use libclang_rt.profile_tvos.a for TVOS targets and libclang_rt.profile_watchos.a for WatchOS targets. I've also fixed up a comment and added an assert() that prevents us from defaulting to an incorrect platform. Differential Revision: http://reviews.llvm.org/D14521 Reviewed-by: t.p.northover llvm-svn: 252558
* Moving FileManager::removeDotPaths to llvm::sys::path::remove_dotsMike Aizatsky2015-11-091-3/+0
| | | | | | Differential Revision: http://reviews.llvm.org/D14394 llvm-svn: 252501
* Fixing SPHINX warnings with incorrect indentations.Aaron Ballman2015-11-091-25/+25
| | | | llvm-svn: 252470
* [EABI] Add Clang support for -meabi flagRenato Golin2015-11-092-0/+5
| | | | | | | | | | | | | | The -meabi flag to control LLVM EABI version. Without '-meabi' or with '-meabi default' imply LLVM triple default. With '-meabi gnu' sets EABI GNU. With '-meabi 4' or '-meabi 5' set EABI version 4 and 5 respectively. A similar patch was introduced in LLVM. Patch by Vinicius Tinti. llvm-svn: 252463
* Remove spaces at start of line, NFC.Yaron Keren2015-11-071-1/+1
| | | | llvm-svn: 252404
* Make a couple methods static.Craig Topper2015-11-071-3/+3
| | | | llvm-svn: 252400
* Make SemaBuiltinCpuSupports a static function. NFC.Craig Topper2015-11-071-1/+0
| | | | llvm-svn: 252399
* Add support for function attribute 'not_tail_called'.Akira Hatanaka2015-11-063-0/+57
| | | | | | | | | | | | | | | | | | | | | | This attribute is used to prevent tail-call optimizations to the marked function. For example, in the following piece of code, foo1 will not be tail-call optimized: int __attribute__((not_tail_called)) foo1(int); int foo2(int a) { return foo1(a); // Tail-call optimization is not performed. } The attribute has effect only on statically bound calls. It has no effect on indirect calls. Also, virtual functions and objective-c methods cannot be marked as 'not_tail_called'. rdar://problem/22667622 Differential Revision: http://reviews.llvm.org/D12922 llvm-svn: 252369
* Fixing line endings; NFC.Aaron Ballman2015-11-061-3/+3
| | | | llvm-svn: 252314
OpenPOWER on IntegriCloud