summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Change arc-cxx11-init-list.mm to work with upcoming SCEV changes.Sanjoy Das2015-09-251-2/+0
| | | | | | | | | | | | | | | Summary: The store being checked for in arc-cxx11-init-list.mm is a store to an unescaped alloca. After an uncoming change to ScalarEvolution, LLVM is able to elide the store, so adjust the test accordingly. Reviewers: compnerd Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13183 llvm-svn: 248632
* Relax test to allow for __attribute__((thiscall)). Under Win32 c-index-test ↵Yaron Keren2015-09-251-2/+2
| | | | | | | | | output is CXXMethod=foo:4:7 (unavailable) [type=int () __attribute__((thiscall))] [typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0] CXXConstructor=Foo:5:3 (unavailable) [type=void () __attribute__((thiscall))] [typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0] llvm-svn: 248626
* Fix bug on reporting availability of deleted methods in libclang.Manuel Klimek2015-09-252-1/+14
| | | | | | Patch by Sergey Kalinichev. llvm-svn: 248596
* Make incomplete type errors better with enable_ifGeorge Burgess IV2015-09-252-11/+24
| | | | | | | | | | | | This patch fixes the order in which we evaluate the different ways that a function call could be disallowed. Now, if you call a non-overloaded function with an incomplete type and failing enable_if, we'll prioritize reporting the more obvious error (use of incomplete type) over reporting the failing enable_if. Thanks to Ettore Speziale for the patch! llvm-svn: 248595
* The Clang gcc-compatible driver (clang/tools/driver/driver.cpp) has someEric Christopher2015-09-253-93/+124
| | | | | | | | | | | | | | | | | | | | | | | logic to select an alternate target based on the executable it was called as. For instance, if you symlink i686-linux-android-gcc to clang and invoke it, the driver will act as though it were called with another argument ("-target i686-linux-android"). This leads to visible effects even in syntax-only compilations (like the ANDROID preprocessor symbol being defined). This behavior is not replicated for tool invocations--for instance, clang::createInvocationFromCommandLine will not choose an alternate target based on ArgList[0]. This means that configurations stored in compilation databases aren't accurately replayed. This patch separates the logic for selecting a mode flag and target from the executable name into a new member function on ToolChain. It should have no functional effects (but will allow other code to reuse the target/mode selection logic). Patch by Luke Zarko! llvm-svn: 248592
* Revert "This patch adds missing pieces to clang, including the PS4 toolchain ↵Greg Bedwell2015-09-2517-705/+8
| | | | | | | | definition, added warnings, PS4 defaults, and Driver changes needed for our compiler." This reverts commit r248546 to get our bot green again while we discuss the best way forward. llvm-svn: 248578
* [OPENMP 4.1] Add 'threads' clause for '#pragma omp ordered'.Alexey Bataev2015-09-2521-35/+258
| | | | | | | | OpenMP 4.1 extends format of '#pragma omp ordered'. It adds 3 additional clauses: 'threads', 'simd' and 'depend'. If no clause is specified, the ordered construct behaves as if the threads clause had been specified. If the threads clause is specified, the threads in the team executing the loop region execute ordered regions sequentially in the order of the loop iterations. The loop region to which an ordered region without any clause or with a threads clause binds must have an ordered clause without the parameter specified on the corresponding loop directive. llvm-svn: 248569
* New test ps4-linker-win.c (added in r48546) is causing problems for Windows ↵Ekaterina Romanova2015-09-251-26/+0
| | | | | | bots. I'm deleting this file during investigation. llvm-svn: 248567
* This patch adds missing pieces to clang, including the PS4 toolchainEkaterina Romanova2015-09-2418-8/+731
| | | | | | | | | | | definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D11279 llvm-svn: 248546
* Move the darwin define static function to be close to the OS define.Eric Christopher2015-09-241-24/+23
| | | | llvm-svn: 248539
* Use just one larger anonymous namespace instead of a lot of smaller ones.Eric Christopher2015-09-241-15/+0
| | | | llvm-svn: 248538
* fix typos; NFCSanjay Patel2015-09-241-3/+3
| | | | llvm-svn: 248537
* Recommit r248154: [ARM] Handle DSP feature as an ArchExtKindArtyom Skrobov2015-09-242-22/+22
| | | | | | | | | | | | | | | | Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in a hand-rolled tricky condition block in lib/Basic/Targets.cpp, with a FIXME: attached. http://reviews.llvm.org/D12937 moved the handling of the DSP feature over to ARMTargetParser.def in LLVM, to be in line with other architecture extensions. This is the corresponding patch to clang, to clear the FIXME: and update the tests. Differential Revision: http://reviews.llvm.org/D12938 llvm-svn: 248521
* Enable SafeStack on all Linux platforms.Evgeniy Stepanov2015-09-242-1/+3
| | | | llvm-svn: 248518
* [analyzer] When memcpy'ing into a fixed-size array, do not invalidate entire ↵Devin Coughlin2015-09-244-11/+1096
| | | | | | | | | | | | | | | | | | | | region. Change the analyzer's modeling of memcpy to be more precise when copying into fixed-size array fields. With this change, instead of invalidating the entire containing region the analyzer now invalidates only offsets for the array itself when it can show that the memcpy stays within the bounds of the array. This addresses false positive memory leak warnings of the kind reported by krzysztof in https://llvm.org/bugs/show_bug.cgi?id=22954 (This is the second attempt, now with assertion failures resolved.) A patch by Pierre Gousseau! Differential Revision: http://reviews.llvm.org/D12571 llvm-svn: 248516
* Module Debugging: Emit submodules as nested DW_TAG_modules.Adrian Prantl2015-09-245-13/+35
| | | | llvm-svn: 248511
* Debug Info: Use the module pointer as key for the module cache.Adrian Prantl2015-09-243-6/+11
| | | | | | This way we don't need to rebuild the full module name for every decl. llvm-svn: 248510
* Refactor ASTSourceDescriptor to not store copies of all strings. (NFC)Adrian Prantl2015-09-243-14/+29
| | | | llvm-svn: 248509
* Drop useless const in for-range loops.Benjamin Kramer2015-09-244-11/+11
| | | | | | | | StringRefs always point to immutable memory so the const doesn't add value here. Also quiets clang's -Wrange-loop-analysis which warns about the implicit copying. llvm-svn: 248496
* [Driver] Don't implicitly copy std::strings in for-range loop.Benjamin Kramer2015-09-241-1/+1
| | | | | | Found by -Wrange-loop-analysis. llvm-svn: 248495
* [mips] Relax -mnan=2008 acceptance to permit MIPS32R2 and MIPS64R2.Daniel Sanders2015-09-242-15/+38
| | | | | | | | | | | | | | | Summary: Strictly speaking, the MIPS*R2 ISA's should not permit -mnan=2008 since this feature was added in MIPS*R3. However, other toolchains permit this and we should do the same. Reviewers: atanasyan Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13057 llvm-svn: 248481
* [ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev2015-09-241-1/+1
| | | | | | | | | | | Fix of dangling StringRef after temporary std::string is destroyed Follow-up to: http://reviews.llvm.org/rL248479 Reviewers: alexfh Subscribers: cfe-commits llvm-svn: 248480
* [ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev2015-09-241-3/+3
| | | | | | | | | | | Fix of dangling StringRef after temporary std::string is destroyed Follow-up to: http://reviews.llvm.org/rL248370 Reviewers: alexfh Subscribers: cfe-commits llvm-svn: 248479
* [Driver] Add support for Windows 10 SDKIgor Kudrin2015-09-242-68/+102
| | | | | | | | | | | | | | | | Summary: With Windows 10 SDK, Include and Lib directories now contain an additional subfolder with the name that corresponds to the full version of the SDK, for example: - C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um - C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x64 Reviewers: ruiu, rnk Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D12832 llvm-svn: 248463
* cuda-path: StringRef cannot be used here.NAKAMURA Takumi2015-09-241-1/+1
| | | | llvm-svn: 248459
* clang/test/Analysis/malloc-overflow2.c: Appease 32-bit targets.NAKAMURA Takumi2015-09-241-1/+1
| | | | | | size_t is not unsigned long for targeting i686 (and Windows x64). llvm-svn: 248458
* Make a test a bit shorter. No behavior change.Nico Weber2015-09-241-5/+1
| | | | llvm-svn: 248456
* Improve the printing of ranges when macros are involved.Richard Trieu2015-09-248-99/+166
| | | | | | | | | | | | Trace the ranges through the macro backtrace better. This allows better range highlighting through all levels of the macro bracktrace. Also some improvements to backtrace printer for omitting different backtraces. Patch by Zhengkai Wu. Differential Revision: http://reviews.llvm.org/D12379 llvm-svn: 248454
* Disabled one of the test runs in cuda-detect.cuArtem Belevich2015-09-241-2/+0
| | | | | | | --sysroot apparently can't handle long paths which triggers test failure on some platforms. llvm-svn: 248448
* [analyzer] Discard malloc-overflow bug-report when a known size is malloc'ed.Devin Coughlin2015-09-233-34/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch ignores malloc-overflow bug in two cases: Case1: x = a/b; where n < b malloc (x*n); Then x*n will not overflow. Case2: x = a; // when 'a' is a known value. malloc (x*n); Also replaced isa with dyn_cast. Reject multiplication by zero cases in MallocOverflowSecurityChecker Currently MallocOverflowSecurityChecker does not catch cases like: malloc(n * 0 * sizeof(int)); This patch rejects such cases. Two test cases added. malloc-overflow2.c has an example inspired from a code in linux kernel where the current checker flags a warning while it should not. A patch by Aditya Kumar! Differential Revision: http://reviews.llvm.org/D9924 llvm-svn: 248446
* [darwin] [builtins] Stop generating cc_kext_ios5 and move iOS architectures ↵Chris Bieneman2015-09-232-6/+4
| | | | | | | | | | | | | | | | | out of cc_kext into cc_kext_ios Summary: This corresponds to a patch to compiler-rt (D13112). Xcode 7 doesn't support targeting iOS5 and earlier. Instead of just dropping cc_kext_ios5, I've repurposed it to cc_kext_ios, and I'm pulling the iOS architectures out of cc_kext. Putting OS X and iOS slices inside the same archive was just odd. Reviewers: bogner, bob.wilson Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13113 llvm-svn: 248442
* Forbid qualifiers on ObjC generic parameters and arguments, butJohn McCall2015-09-239-25/+385
| | | | | | | | | | | | | | silently ignore them on arguments when they're provided indirectly (.e.g behind a template argument or typedef). This is mostly just good language design --- specifying that a generic argument is __weak doesn't actually do anything --- but it also prevents assertions when trying to apply a different ownership qualifier. rdar://21612439 llvm-svn: 248436
* Remove warning on over-wide bit-field of boolean type; there's no risk thatRichard Smith2015-09-235-12/+18
| | | | | | | | | | someone thought all the bits would be value bits in this case. Also fix the wording of the warning -- it claimed that the width of 'bool' is 8, which is not correct; the width is 1 bit, whereas the size is 8 bits in our implementation. llvm-svn: 248435
* [CUDA] Added CUDA installation detector class.Artem Belevich2015-09-238-1/+91
| | | | | | | | | | | Added new option --cuda-path=<path> which allows overriding default search paths. If it's not specified we look for CUDA installation in /usr/include/cuda and /usr/include/cuda-7.0. Differential Revision: http://reviews.llvm.org/D12989 llvm-svn: 248433
* [analyzer] Improve localizability checks for iOS / OS X.Devin Coughlin2015-09-234-107/+861
| | | | | | | | | | | | | | | | | | | | Various improvements to the localization checker: * Adjusted copy to be consistent with diagnostic text in other Apple API checkers. * Added in ~150 UIKit / AppKit methods that require localized strings in UnlocalizedStringsChecker. * UnlocalizedStringChecker now checks for UI methods up the class hierarchy and UI methods that conform for a certain Objective-C protocol. * Added in alpha version of PluralMisuseChecker and some regression tests. False positives are still not ideal. (This is the second attempt, with the memory issues on Linux resolved.) A patch by Kulpreet Chilana! Differential Revision: http://reviews.llvm.org/D12417 llvm-svn: 248432
* PR14858: Initial support for proper sizeof... handling within alias templates.Richard Smith2015-09-2312-80/+246
| | | | | | | This doesn't quite get alias template equivalence right yet, but handles the egregious cases where we would silently give the wrong answers. llvm-svn: 248431
* Remove wrong implication that value-dependent implies instantiation-dependent,Richard Smith2015-09-232-4/+2
| | | | | | | | | and fix the only code that was depending on this so that it sets all the relevant flags appropriately. No functionality change intended. llvm-svn: 248430
* Support linking against OpenMP runtime on NetBSD.Joerg Sonnenberger2015-09-232-0/+13
| | | | llvm-svn: 248426
* Push OpenMP linker flags after linker input on Darwin. Don't add anyJoerg Sonnenberger2015-09-232-2/+29
| | | | | | libraries if -nostdlib is specified. Test. llvm-svn: 248424
* Reverted r248408 "[CUDA] Added CUDA installation detector class."Artem Belevich2015-09-238-85/+1
| | | | | | because included test fails on some platforms. llvm-svn: 248413
* [CUDA] Added CUDA installation detector class.Artem Belevich2015-09-238-1/+85
| | | | | | | | | | | Added new option --cuda-path=<path> which allows overriding default search paths. If it's not specified we look for CUDA installation in /usr/include/cuda and /usr/include/cuda-7.0. Differential Revision: http://reviews.llvm.org/D12989 llvm-svn: 248408
* [CUDA] __global__ functions should always be visible externally.Artem Belevich2015-09-233-15/+7
| | | | | | | | | Adjust __global__ functions with DiscardableODR linkage to use StrongODR linkage instead, so they are visible externally. Differential Revision: http://reviews.llvm.org/D13067 llvm-svn: 248400
* [Lex] A source-file new-line in a raw string literal results in a new-lineDavid Majnemer2015-09-232-4/+34
| | | | | | | | | Our string literal parser copied any source-file new-line characters into the execution string-literal. This is incorrect if the source-file new-line character was a \r\n sequence because new-line characters are merely \n. llvm-svn: 248392
* [Sema] Don't create an invalid source range for overlong initializer lists.Benjamin Kramer2015-09-232-2/+8
| | | | | | | | | We took both source locations from the end of the initializer list what the code below doesn't expect. This can lead to a crash when rendering the diagnostic (PR24816). Assert that we have more than one element in a scalar initializer with too many elements. llvm-svn: 248391
* Refactor library decision for -fopenmp support from Darwin into aJoerg Sonnenberger2015-09-231-17/+23
| | | | | | function for sharing with other platforms. llvm-svn: 248379
* Add -fplugin=name.so option to the driverJohn Brawn2015-09-233-0/+16
| | | | | | | | This translates to -load name.so in the cc1 command. We can't name the driver option -load, as that means "link against oad", so instead we follow GCC's lead and name the option -fplugin. llvm-svn: 248378
* [DeclPrinter] Don't crash when printing a using decl with a special nameBenjamin Kramer2015-09-232-1/+9
| | | | | | Fixes PR24872. llvm-svn: 248376
* Fix bad iterator access.Daniel Jasper2015-09-231-1/+2
| | | | llvm-svn: 248375
* [ARM] Fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev2015-09-235-12/+35
| | | | | | | | | | | | | | | | An assertion hit has been fixed for cmdlines like $ clang --target=arm-linux-gnueabi -mcpu=generic hello.c Related to: http://reviews.llvm.org/rL245445 Reviewers: rengolin Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13013 llvm-svn: 248370
* clang-format: Add initial #include sorting capabilities.Daniel Jasper2015-09-2311-36/+509
| | | | | | | | | To implement this nicely, add a function that merges two sets of replacements that are meant to be done in sequence. This functionality will also be useful for other applications, e.g. formatting the result of clang-tidy fixes. llvm-svn: 248367
OpenPOWER on IntegriCloud