summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [CUDA] Added a wrapper header for inclusion of stock CUDA headers.Artem Belevich2015-11-172-0/+180
| | | | | | | | | | | | | | | | | | | | Header files that come with CUDA are assuming split host/device compilation and are not usable by clang out of the box. With a bit of preprocessor magic it's possible to twist them into something clang can use. This wrapper always includes CUDA headers exactly the same way during host and device compilation passes and produces identical preprocessed content during host and device side compilation for sm_35 GPUs. Device compilation passes for older GPUs will see a smaller subset of device functions supported by particular GPU. The wrapper assumes specific contents of CUDA header files and works only with CUDA 7.0 and 7.5. Differential Revision: http://reviews.llvm.org/D13171 llvm-svn: 253388
* [CUDA] Detect and link with CUDA's libdevice bitcode library.Artem Belevich2015-11-176-4/+75
| | | | | | | | | | | - 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-178-6/+66
| | | | | | | | | | | | | | | | | | | | | 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-179-75/+109
| | | | | | | | | | | | | | | | 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
* Use !hasArg with two options instead of !hasArg && !hasArg.Douglas Katzman2015-11-172-92/+59
| | | | | | Thereby fixing a warning about failure to claim all args. llvm-svn: 253372
* [Lit Test] Updated 34 Lit tests to be C++11 compatible.Charles Li2015-11-1734-26/+260
| | | | | | | Added expected diagnostics new to C++11. Expanded RUN line to: default, C++98/03 and C++11. llvm-svn: 253371
* bmiintrin.h: Allow using the tzcnt intrinsics for non-BMI targetsHans Wennborg2015-11-171-3/+9
| | | | | | | | | | | | The tzcnt intrinsics are used non non-BMI targets by code (e.g. ffmpeg) that uses it as a potentially faster BSF. The TZCNT instruction is special in that it's encoded in a backward-compatible way and behaves as BSF on non-BMI targets. Differential Revision: http://reviews.llvm.org/D14748 llvm-svn: 253358
* ARM: fix mismatch between Clang and backend on exception type.Tim Northover2015-11-172-7/+11
| | | | | | | | | | | | "-arch armv7k" is only normally used with a watchos target, but Clang doesn't stop you from giving a "-miphoneos-version-min" option too, converting the triple to "thumbv7k-apple-ios". In this case the backend will decide to use SjLj exceptions, so Clang needs to agree so it can create the correct predefines. Fortunately, there's a handy function to make the decision for us now. llvm-svn: 253355
* Add trivial utility to append -L arguments to linker step. NFCDouglas Katzman2015-11-173-35/+19
| | | | llvm-svn: 253350
* Revert "Make FP_CONTRACT ON the default."Manuel Klimek2015-11-176-192/+15
| | | | | | | | | 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] Remove unnecessary typecast of bool to int when passing arguments to ↵Craig Topper2015-11-171-9/+8
| | | | | | diagnostics. NFC llvm-svn: 253316
* [Sema] Combine similar diagnostics using %select. NFCCraig Topper2015-11-174-32/+19
| | | | llvm-svn: 253315
* [Sema] Minor formatting fixes. NFCCraig Topper2015-11-174-6/+6
| | | | llvm-svn: 253314
* [modules] Fix some more cases where we used to reject a conflict between twoRichard Smith2015-11-176-8/+49
| | | | | | | 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-166-15/+192
| | | | | | Differential Revision: D14200 llvm-svn: 253269
* Derive nacltools::Linker from GnuTool to get response file supportDerek Schuff2015-11-161-2/+2
| | | | | | | It could be derived from gnutools::Linker directly but this way makes it consistent with all the other toolchains around it. llvm-svn: 253259
* Correctly handle type mismatches in the __weak copy/move-initializationJohn McCall2015-11-163-2/+66
| | | | | | | | peephole I added in r250916. rdar://23559789 llvm-svn: 253255
* When producing error messages for always_inline functions with theEric Christopher2015-11-162-2/+14
| | | | | | | | | | target attribute, don't include "negative" subtarget features in the list of required features. Builtins are positive by default so don't need this change, but we pull the default list of features from the command line and so need to make sure that we only include features that are turned on for code generation in our error. llvm-svn: 253242
* [mips] Do not add arch name in the compiler-rt's components.Vasileios Kalintiris2015-11-162-3/+2
| | | | | | | Instead, use the constant "mips" since the libraries are already placed under the multilib's OS suffix. llvm-svn: 253214
* [Myriad]: pass the 'std=' option to moviCompileDouglas Katzman2015-11-162-1/+5
| | | | llvm-svn: 253213
* [ARM,AArch64] Fix __rev16l and __rev16ll intrinsicsOliver Stannard2015-11-162-16/+46
| | | | | | | | | | | | | | | | | | | | These two intrinsics are defined in arm_acle.h. __rev16l needs to rotate by 16 bits, bit it was actually rotating by 2 bits. For AArch64, where long is 64 bits, this would still be wrong. __rev16ll was incorrect, it reversed the bytes in each 32-bit word, rather than each 16-bit halfword. The correct implementation is to apply __rev16 to the top and bottom words of the 64-bit value. For AArch32 targets, these get compiled down to the hardware rev16 instruction at -O1 and above. For AArch64 targets, the 64-bit ones get compiled to two 32-bit rev16 instructions, because there is not currently a pattern for the 64-bit rev16 instruction. Differential Revision: http://reviews.llvm.org/D14609 llvm-svn: 253211
* Handle ARMv6KZ namingArtyom Skrobov2015-11-162-5/+8
| | | | | | | | | | | | Summary: Update for clang tests for D14568 Reviewers: rengolin, joerg, bogden Subscribers: aemerson, rengolin, cfe-commits Differential Revision: http://reviews.llvm.org/D14570 llvm-svn: 253207
* clang-format: Enable #include sorting by default.Daniel Jasper2015-11-169-17/+46
| | | | | | | | | 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
* [ARM] Pass in the architecture to TargetParser to cope with API changeBradley Smith2015-11-161-2/+3
| | | | | | | | The TargetParser API to get the default FPU and default extensions has changed so that it can fall back to the architecture in case of a generic CPU. llvm-svn: 253199
* Update for the gnu flavor being renamed to old-gnu.Rafael Espindola2015-11-164-10/+10
| | | | llvm-svn: 253191
* [CGDebugInfo] Set the size and align for reference typesKeno Fischer2015-11-162-7/+8
| | | | | | | | | | In r253186, I changed the DIBuilder API to now take size and align for reference types as well. This was done in preparation for upcoming changes to the Verifier that will validate that sizes match between DI types and IR values that are declared as having those types. This updates clang to actually pass the information through. llvm-svn: 253190
* [Sema] Implement several unary type traits more accuratelyDavid Majnemer2015-11-164-32/+62
| | | | | | | | | | | | | | is_empty, is_polymorphic, and is_abstract didn't handle incomplete types correctly. Only non-union class types must be complete for these traits. is_final and is_sealed don't care about the particular spelling of the FinalAttr. is_interface_class should always return false regardless of its input. The type trait can only be satisfied in a mode we do not support (/CLR). llvm-svn: 253184
* [Basic] Replace vector<bool> with BitVector in SourceManager. NFC.Vedant Kumar2015-11-161-1/+2
| | | | llvm-svn: 253181
* [Frontend] Rangify for loop. NFC.Vedant Kumar2015-11-161-2/+2
| | | | llvm-svn: 253178
* [Basic] Use a bitfield in SLocEntry for clarity. NFC.Vedant Kumar2015-11-161-5/+10
| | | | llvm-svn: 253177
* [analyzer] Handle calling ObjC super method from inside C++ lambda.Devin Coughlin2015-11-152-0/+63
| | | | | | | | | | When calling a ObjC method on super from inside a C++ lambda, look at the captures to find "self". This mirrors how the analyzer handles calling super in an ObjC block and fixes an assertion failure. rdar://problem/23550077 llvm-svn: 253176
* [Sema] Use getLangOpts in Sema instead of Preprocessor. Call getTargetInfo ↵Craig Topper2015-11-152-10/+9
| | | | | | on the AST context instead of Preprocessor. NFC llvm-svn: 253175
* [Sema] Fix filename in header. NFCCraig Topper2015-11-151-1/+1
| | | | llvm-svn: 253174
* [Sema] Remove unnecessary includes and forward declarations. NFCCraig Topper2015-11-152-5/+0
| | | | llvm-svn: 253173
* [X86][MMX] Added MMX IR + assembly codegen builtin tests for some missing ↵Simon Pilgrim2015-11-151-14/+81
| | | | | | cvt intrinsics llvm-svn: 253169
* [libclang] Visit TypeAliasTemplateDeclSergey Kalinichev2015-11-158-3/+24
| | | | | | | | This makes TypeAliasTemplateDecl accessible via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13844 llvm-svn: 253166
* [libclang] Expose AutoTypeSergey Kalinichev2015-11-154-6/+10
| | | | | | | | Expose the AutoType via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13000 llvm-svn: 253165
* Remove some trailing whitespaceSergey Kalinichev2015-11-151-10/+10
| | | | llvm-svn: 253164
* Make the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.Yaron Keren2015-11-152-4/+2
| | | | | | Post-commit suggestion by Filipe Cabecinhas. llvm-svn: 253161
* Fix a layering oddity by passing Sema to DeclSpec::Finish instead of ↵Craig Topper2015-11-154-58/+48
| | | | | | DiagnosticsEngine and Preprocessor. Everything the preprocessor was being used for can be acquired from Sema. llvm-svn: 253158
* [analyzer] Refer to capture field to determine if capture is reference.Devin Coughlin2015-11-152-5/+77
| | | | | | | | | | | | | The analyzer incorrectly treats captures as references if either the original captured variable is a reference or the variable is captured by reference. This causes the analyzer to crash when capturing a reference type by copy (PR24914). Fix this by refering solely to the capture field to determine when a DeclRefExpr for a lambda capture should be treated as a reference type. https://llvm.org/bugs/show_bug.cgi?id=24914 rdar://problem/23524412 llvm-svn: 253157
* [Sema] Don't crash trying to diagnose abs called on a pointer typeDavid Majnemer2015-11-153-2/+34
| | | | | | | | | | | | | | | | | 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
* Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFCCraig Topper2015-11-159-42/+35
| | | | llvm-svn: 253155
* [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-146-55/+60
| | | | | | ParserDiagnostic.h diagnostics. llvm-svn: 253143
* Fix indentation. NFCCraig Topper2015-11-141-6/+6
| | | | llvm-svn: 253142
* Merge some similar diagnostics using %select.Craig Topper2015-11-146-41/+34
| | | | llvm-svn: 253136
* Minor formatting fixes. NFCCraig Topper2015-11-141-2/+1
| | | | llvm-svn: 253135
* Fix 80 column violation. NFC.Craig Topper2015-11-141-2/+2
| | | | llvm-svn: 253134
* Fix spelling error in comment.Craig Topper2015-11-141-1/+1
| | | | llvm-svn: 253133
OpenPOWER on IntegriCloud