summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* clang-format: Alphabetize FormatStyle membersBirunthan Mohanathas2015-06-281-33/+33
| | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D10784 llvm-svn: 240907
* [Driver] x86-64 Windows is always PICDavid Majnemer2015-06-281-2/+6
| | | | | | This fixes PR23963. llvm-svn: 240902
* clang-format: Support @autoreleasepool.Nico Weber2015-06-281-0/+10
| | | | | | | | | | Format @autoreleasepool properly for the Attach brace style by recognizing @autoreleasepool as a block introducer. Patch from Strager Neds! http://reviews.llvm.org/D10372 llvm-svn: 240896
* [Sema] Unions cannot have virtual functions.Davide Italiano2015-06-271-0/+5
| | | | | | | | PR: PR23931 Differential Revision: http://reviews.llvm.org/D10752 Reviewed by: rsmith llvm-svn: 240889
* Add missing builtins to altivec.h for ABI compliance (vol. 1)Nemanja Ivanovic2015-06-262-13/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D10637 This is the first round of additions of missing builtins listed in the ABI document. More to come (this builds onto what seurer already addes). This patch adds: vector signed long long vec_abs(vector signed long long) vector double vec_abs(vector double) vector signed long long vec_add(vector signed long long, vector signed long long) vector unsigned long long vec_add(vector unsigned long long, vector unsigned long long) vector double vec_add(vector double, vector double) vector double vec_and(vector bool long long, vector double) vector double vec_and(vector double, vector bool long long) vector double vec_and(vector double, vector double) vector signed long long vec_and(vector signed long long, vector signed long long) vector double vec_andc(vector bool long long, vector double) vector double vec_andc(vector double, vector bool long long) vector double vec_andc(vector double, vector double) vector signed long long vec_andc(vector signed long long, vector signed long long) vector double vec_ceil(vector double) vector bool long long vec_cmpeq(vector double, vector double) vector bool long long vec_cmpge(vector double, vector double) vector bool long long vec_cmpge(vector signed long long, vector signed long long) vector bool long long vec_cmpge(vector unsigned long long, vector unsigned long long) vector bool long long vec_cmpgt(vector double, vector double) vector bool long long vec_cmple(vector double, vector double) vector bool long long vec_cmple(vector signed long long, vector signed long long) vector bool long long vec_cmple(vector unsigned long long, vector unsigned long long) vector bool long long vec_cmplt(vector double, vector double) vector bool long long vec_cmplt(vector signed long long, vector signed long long) vector bool long long vec_cmplt(vector unsigned long long, vector unsigned long long) llvm-svn: 240821
* [PPC]: Fix bug in getMultiarchTriple.Douglas Katzman2015-06-261-18/+22
| | | | | | | | And generally prefer not to restate TargetTriple.str() over and over. Differential Revision: http://reviews.llvm.org/D10605 llvm-svn: 240808
* [static analyzer] Analyzer is skipping forward declared C/C++ functionsAnna Zaks2015-06-261-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | A patch by Karthik Bhat! This patch fixes a regression introduced by r224398. Prior to r224398 we were able to analyze the following code in test-include.c and report a null deref in this case. But post r224398 this analysis is being skipped. E.g. // test-include.c #include "test-include.h" void test(int * data) { data = 0; *data = 1; } // test-include.h void test(int * data); This patch uses the function body (instead of its declaration) as the location of the function when deciding if the Decl should be analyzed with path-sensitive analysis. (Prior to r224398, the call graph was guaranteed to have a definition when available.) llvm-svn: 240800
* clang-format some of the files in lib/Driver. NFCDouglas Katzman2015-06-264-1540/+1338
| | | | | | | | | Nothing was hand edited afterward except a few literal strings and comments that were poorly broken. Differential Revision: http://reviews.llvm.org/D10689 llvm-svn: 240791
* [ObjC] Add NSValue support for objc_boxed_expressionsAlex Denisov2015-06-2611-14/+226
| | | | | | | | | | | | | Patch extends ObjCBoxedExpr to accept records (structs and unions): typedef struct __attribute__((objc_boxable)) _Color { int r, g, b; } Color; Color color; NSValue *boxedColor = @(color); // [NSValue valueWithBytes:&color objCType:@encode(Color)]; llvm-svn: 240761
* Fix crash-on-invalid bug in template instantiation.Manuel Klimek2015-06-261-27/+0
| | | | | | | | Get rid of code-path that (according to Richard Smith) is not needed but leads to a crasher bug when assuming a template has been fully instantiated and thus has a definition. llvm-svn: 240752
* Add new file from r240741 to CMakeLists.txt.Nico Weber2015-06-261-0/+1
| | | | llvm-svn: 240743
* [Sema] Commit a better fix for r240242Davide Italiano2015-06-261-4/+5
| | | | | | | | | | | Skip calls to HasTrivialDestructorBody() in the case where the destructor is never invoked. Alternatively, Richard proposed to change Sema to declare a trivial destructor for anonymous union member, which seems too wasteful. Differential Revision: http://reviews.llvm.org/D10508 llvm-svn: 240742
* Add an inttypes.h wrapper that fixes up some macros in Microsoft mode.Nico Weber2015-06-261-0/+102
| | | | | | | | Before MSVS2015, MSVS's headers disagree about int32_t and PRIx32 and so on. Provide a wrapper header to fix this, so that -Wformat can still be used. Fixes PR23412. llvm-svn: 240741
* [Sema] Maintain ellipsis location when transforming lambda capturesMeador Inge2015-06-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a crash caused by the following case: template<typename T> auto f(T x) { auto g = [](auto ... args) { auto h = [args...]() -> int { return 0; }; return h; }; return g; } auto x = f(0)(); When the templated function 'f' is instantiated and the inner-most lambda is transformed the ellipsis location on the captured variable is lost. Then the lambda returned by 'f' is instantiated and the tree transformer chokes on the invalid ellipsis location. The problem is fixed by making a minor change to properly track the ellipsis location. This fixes PR23716. Differential Revision: http://reviews.llvm.org/D10590 llvm-svn: 240740
* [CodeGen] Restrict isTriviallyRecursive to predefined lib functions ↵David Majnemer2015-06-251-2/+7
| | | | | | | | | | | forwarding to lib functions isTriviallyRecursive is only supposed to guard functions part of the implementation. This fixes PR23953. llvm-svn: 240735
* Fix a typo correction crash when resolving ambiguous corrections.Kaelyn Takata2015-06-251-0/+6
| | | | | | | | | | | In certain cases, the tree transform would introduce new TypoExprs while trying one of the corrections, invalidating the unique_ptr in the state reference, and also causing a TypoExpr to exist that will never be corrected since it doesn't exist in the final corrected expression. The simple solution to both problems is to temporarily disable typo correction while handling potentially ambiguous typo corrections. llvm-svn: 240734
* Remove `requires` for x86 CPU features.Sean Silva2015-06-251-25/+0
| | | | | | | | | Ever since the target attributes change, we don't need to guard these headers with `requires`. Actually it's a bit worse, because if we do then they are included textually under the covers, causing declarations to appear in submodules they aren't supposed to be in. llvm-svn: 240720
* [CFI] Diagnose when we CFI in diagnostic mode is unavailable on a toolchain.Alexey Samsonov2015-06-251-1/+17
| | | | | | | | | | | | | | | | | | | | | | | Summary: Namely, we must have proper C++ABI support in UBSan runtime. We don't have a good way to check for that, so just assume that C++ABI support is there whenever -fsanitize=vptr is supported (i.e. only on handful of platforms). Exact diagnostic is also tricky. It's not "cfi" that is unsupported, just the diagnostic mode. So, I suggest to report that "-fno-sanitize-trap=cfi-foobar" is incompatible with a given target toolchain. Test Plan: regression test suite Reviewers: pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10751 llvm-svn: 240716
* Display profile file name when emitting a file not found diagnostic.Diego Novillo2015-06-251-2/+3
| | | | | | | | | When a profile file cannot be opened, we used to display just the error message but not the name of the profile the compiler was trying to open. This will become useful in the next set of patches that introduce GCC-compatible flags to specify profiles. llvm-svn: 240715
* [Parse] Allow 'constexpr' in condition declarationsMeador Inge2015-06-253-8/+9
| | | | | | | | | | | | | | | | | This patch implements the functionality specified by DR948. The changes are two fold. First, the parser was modified to allow 'constexpr's to appear in condition declarations (which was a hard error before). Second, Sema was modified to cleanup maybe odr-used declarations by way of a call to 'ActOnFinishFullExpr'. As 'constexpr's were not allowed in condition declarations before the cleanup wasn't necessary (such declarations were always odr-used). This fixes PR22491. Differential Revision: http://reviews.llvm.org/D8978 llvm-svn: 240707
* [modules] Properly merge visibility of class definitions that got merged whileRichard Smith2015-06-251-5/+7
| | | | | | parsing then merged again when the module was loaded. llvm-svn: 240700
* Rename local variable CCCPrintActions -> CCCPrintPhases.Douglas Katzman2015-06-251-15/+12
| | | | | | | To match the '-ccc-print-phases' command-line flag. Also make two more 'for' loops range-based. NFC llvm-svn: 240680
* Use more range-based for loopsDouglas Katzman2015-06-253-58/+49
| | | | | | Differential Revision: http://reviews.llvm.org/D10738 llvm-svn: 240674
* [CUDA] Implemented __nvvm_atom_*_gen_* builtins.Artem Belevich2015-06-252-52/+128
| | | | | | | | | | | Integer variants are implemented as atomicrmw or cmpxchg instructions. Atomic add for floating point (__nvvm_atom_add_gen_f()) is implemented as a call to an overloaded @llvm.nvvm.atomic.load.add.f32.* LVVM intrinsic. Differential Revision: http://reviews.llvm.org/D10666 llvm-svn: 240669
* Omit 'nodebug' methods from the class description.Paul Robinson2015-06-251-1/+2
| | | | llvm-svn: 240664
* Fix #pragma redefine_extname when there is a local variable of the same ↵Aaron Ballman2015-06-251-2/+17
| | | | | | | | name. The local should not be renamed, only the externally-available declaration should be. Patch by Andrey Bokhanko! llvm-svn: 240653
* Fix a crash by division by zero in analyzerDaniel Marjamaki2015-06-251-0/+4
| | | | | | | | Patch by takeshi-yoshimura! Differential Revision: http://reviews.llvm.org/D10145 llvm-svn: 240643
* Teach Clang about the PPC64 memory sanitizer implementation.Jay Foad2015-06-251-1/+4
| | | | | | | | | | | | | | | | Summary: This is the Clang part of the PPC64 memory sanitizer implementation in D10648. Reviewers: kcc, eugenis, willschm, wschmidt, samsonov Reviewed By: samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10650 llvm-svn: 240628
* clang-format: [Proto] Don't treat "operator" as keyword.Daniel Jasper2015-06-251-5/+6
| | | | | | | | | | Before: optional string operator= 1; After: optional string operator = 1; llvm-svn: 240624
* Update darwin SDK version parsing to support OSX and simulatorSteven Wu2015-06-251-8/+23
| | | | | | | | | | This re-commits r226005 with a tweak. The origin attempt failed because Darwin bot sets up SDKROOT and clang can deduce SDK version from them after this patch. That broke many driver tests due to the change of deployment target version. Now the tests should not complain after r240574. llvm-svn: 240619
* [UBSan] Allow to use -fsanitize=vptr only on Mac OS 10.9+Alexey Samsonov2015-06-251-5/+5
| | | | | | | See https://llvm.org/bugs/show_bug.cgi?id=23539 for why this is necessary. llvm-svn: 240618
* Consolidate and unify initializer list deductionHubert Tong2015-06-251-33/+49
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch reduces duplication in the template argument deduction code for handling deduction from initializer lists in a function call. This extends the fix for PR12119 to also apply to the case where the corresponding parameter is a trailing parameter pack. Test Plan: A test for deduction from nested initializer lists where the corresponding parameter is a trailing parameter pack is added in `clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp`. Reviewers: fraggamuffin, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10681 llvm-svn: 240612
* [Concepts] Parsing of requires-clause in template-declarationHubert Tong2015-06-252-1/+30
| | | | | | | | | | | | | | | | | | | Summary: This change implements parse-only acceptance of the optional requires-clause in a template-declaration. Diagnostic testing is added for cases where the grammar is ambiguous with the expectation that the longest token sequence which matches the syntax of a constraint-expression is consumed without backtracking. Reviewers: faisalv, fraggamuffin, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10462 llvm-svn: 240611
* [ARM] The bits set in the variable HW_FP could get unsetRanjeet Singh2015-06-241-6/+10
| | | | | | | | | | | | when iterating through the Features vector if we don't keep track of what's already been set. This could lead to the macro __ARM_FP getting the wrong value. This patch fixes this issue by keeping track of the bits that have already been set in the loop. Differential Revision: http://reviews.llvm.org/D10395 llvm-svn: 240607
* update commentDerek Schuff2015-06-241-2/+4
| | | | llvm-svn: 240601
* Relax assertion in x86_64 byval argument handling for 32-bit pointersDerek Schuff2015-06-241-1/+2
| | | | | | | | | | | | | | | | Summary: Byval argument pair formation assumes that if a type is less than 8 bytes it must be an integer and not a pointer, which is not true for x32 and NaCl. Relax the assertion and add a test for a codegen case that triggered it. Reviewers: jvoung Subscribers: jfb, cfe-commits Differential Revision: http://reviews.llvm.org/D10701 llvm-svn: 240600
* Add __nonnull/__nullable/__null_unspecified predefines for Darwin.Douglas Gregor2015-06-241-0/+8
| | | | | | Addresses the rest of rdar://problem/21530726. llvm-svn: 240597
* Replace __double_underscored type nullability qualifiers with ↵Douglas Gregor2015-06-2413-95/+120
| | | | | | | | | | | | | | | | _Uppercase_underscored Addresses a conflict with glibc's __nonnull macro by renaming the type nullability qualifiers as follows: __nonnull -> _Nonnull __nullable -> _Nullable __null_unspecified -> _Null_unspecified This is the major part of rdar://problem/21530726, but does not yet provide the Darwin-specific behavior for the old names. llvm-svn: 240596
* [Preprocessor] Iterating over all macros should include those from modules.Jordan Rose2015-06-241-0/+4
| | | | | | | | | | | | So, iterate over the list of macros mentioned in modules, and make sure those are in the master table. This isn't particularly efficient, but hopefully it's something that isn't done too often. PR23929 and rdar://problem/21480635 llvm-svn: 240571
* clang-format: [JS] Support regex literals containing quotes (' and ").Daniel Jasper2015-06-241-3/+23
| | | | llvm-svn: 240548
* Express Driver::GetFilePath more concisely.Douglas Katzman2015-06-241-14/+5
| | | | llvm-svn: 240545
* [OPENMP] Codegen for 'depend' clause (OpenMP 4.0).Alexey Bataev2015-06-243-37/+196
| | | | | | | | If task directive has associated 'depend' clause then function kmp_int32 __kmpc_omp_task_with_deps ( ident_t *loc_ref, kmp_int32 gtid, kmp_task_t * new_task, kmp_int32 ndeps, kmp_depend_info_t *dep_list,kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list) must be called instead of __kmpc_omp_task(). If this directive has associated 'if' clause then also before a call of kmpc_omp_task_begin_if0() a function void __kmpc_omp_wait_deps ( ident_t *loc_ref, kmp_int32 gtid, kmp_int32 ndeps, kmp_depend_info_t *dep_list, kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list) must be called. Array sections are not supported yet. llvm-svn: 240532
* Remove a limited and somewhat questionable DenseMapInfo specializationChandler Carruth2015-06-241-14/+0
| | | | | | for StringRef now that the core DenseMap library provides this facility. llvm-svn: 240530
* Move the special-case check from r240462 into ARM-specific code.Bob Wilson2015-06-241-19/+53
| | | | | | | | | | | | | | | | | | | This fixes a serious bug in r240462: checking the BuiltinID for ARM::BI_MoveToCoprocessor* in EmitBuiltinExpr() ignores the fact that each target has an overlapping range of the BuiltinID values. That check can trigger for builtins from other targets, leading to very bad behavior. Part of the reason I did not implement r240462 this way to begin with is the special handling of the last argument for Neon builtins. In this change, I have factored out the check to see which builtins have that extra argument into a new HasExtraNeonArgument() function. There is still some awkwardness in having to check for those builtins in two separate places, i.e., once to see if the extra argument is present and once to generate the appropriate IR, but this seems much cleaner than my previous patch. llvm-svn: 240522
* Proper changing/restoring for CapturedStmtInfo, NFC.Alexey Bataev2015-06-243-9/+20
| | | | | | Added special RAII class for proper values changing/restoring in CodeGenFunction::CapturedStmtInfo. llvm-svn: 240517
* Use range-based loops when handling OPT_print_search_dirs.Douglas Katzman2015-06-231-11/+11
| | | | llvm-svn: 240476
* [Driver] Give GnuTool LLVM_LIBRARY_VISIBILITY.Benjamin Kramer2015-06-231-1/+1
| | | | | | This is consistent with all other classes in Tools.h. llvm-svn: 240464
* PR22560: Fix argument order for ARM _MoveToCoprocessor builtins.Bob Wilson2015-06-231-0/+8
| | | | | | | | | | | | | | | | The Microsoft-extension _MoveToCoprocessor and _MoveToCoprocessor2 builtins take the register value to be moved as the first argument, but the corresponding mcr and mcr2 LLVM intrinsics expect that value to be the third argument. Handle this as a special case, while still leaving those intrinsics as generic MSBuiltins. I considered the alternative of handling these in EmitARMBuiltinExpr, but that does not work well for the follow-up change that I'm going to make to improve the error handling for PR22560 -- we need the GetBuiltinType() checks for ICEArguments, and the ARM version of that code is only used for Neon intrinsics where the last argument is special and not checked in the normal way. llvm-svn: 240462
* Pedantically rename all Tool subclasses to be nouns, not verbs. NFCDouglas Katzman2015-06-236-476/+443
| | | | | | | | | | | | | | | | | | Classes in Tools.h inherit ultimately from Tool, which is a noun, but subclasses of Tool were named for their operation, such as "Compile", wherein the constructor call "Compile(args...)" could be misconstrued as actually causing a compile to happen. Likewise various other methods were not harmonious with their effect, in that "BuildLinker()" returned a "new namespace::Link(...)" instead of a "new namespace::Linker(...)" which it now does. Exceptions: Clang and ClangAs are un-renamed. Those are their rightful names. And there is no particulary great way to name the "Lipo-er" and a few others. Differential Revision: http://reviews.llvm.org/D10595 llvm-svn: 240455
* [MS ABI] Account for the virtual inheritance quirk when manglingDavid Majnemer2015-06-233-29/+24
| | | | | | | | | | | | Virtual inheritance member pointers are always relative to the vbindex, even when the member pointer doesn't point into a virtual base. This is corrected by adjusting the non-virtual offset backwards from the vbptr back to the top of the most derived class. While we performed this adjustment when manifesting member pointers as constants or when performing conversions, we didn't perform the adjustment when mangling them. llvm-svn: 240453
OpenPOWER on IntegriCloud