summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Do not force "-static" for aarch64 iOS kernel/kext assembly code.Bob Wilson2015-02-101-2/+1
| | | | | | | | | | | Somehow a check for aarch64 was added to the Darwin toolchain's isKernelStatic function as part of the initial commit for Apple's arm64 target (r205100). That check was not in any of Apple's internal code and no one here knows where it came from. It has been harmless because "-static" does not change much, if anything, for arm64 iOS code, but it makes no sense to keep this check. llvm-svn: 228673
* [modules] When determining whether a name from a module replaces a name weRichard Smith2015-02-103-53/+106
| | | | | | | | | already have, check whether the name from the module is actually newer than the existing declaration. If it isn't, we might (say) replace a visible declaration with an injected friend, and thus make it invisible (or lose a default argument or an array bound). llvm-svn: 228661
* A temporary fix for backward compatibility breakages caused by PR12117.Larisse Voufo2015-02-101-4/+15
| | | | llvm-svn: 228654
* [Static Analyzer] The name of the checker that reports a bug is addedGabor Horvath2015-02-091-1/+3
| | | | | | | | | | | to the plist output. This check_name field does not guaranteed to be the same as the name of the checker in the future. Reviewer: Anna Zaks Differential Revision: http://reviews.llvm.org/D6841 llvm-svn: 228624
* Be more conservative about gethostname()'s truncating behaviourBen Langmuir2015-02-091-1/+5
| | | | | | | | Don't assume it will provide an error or null-terminate the string on truncation, since POSIX doesn't guarantee either behaviour (although Linux and Darwin at least will do the 'right thing'). llvm-svn: 228613
* Diagnose timeouts in the LockFileManager and delete the dead lock fileBen Langmuir2015-02-091-2/+12
| | | | | | | | | | | | If the lock file manager times out, we should give an error rather than silently trying to load the existing module. And delete the (presumably) dead lock file, since it will otherwise prevent progress in future invokations. This is unsound since we have no way to prove that the lock file we are deleting is the same one we timed out on, but since the lock is only to avoid excessive rebuilding anyway it should be okay. Depends on llvm r228603. llvm-svn: 228604
* Update r228592 for when gethostname() returns an errorBen Langmuir2015-02-091-3/+3
| | | | | | | | | If gethostname() is not successful, just skip adding the hostname to the module hash. And don't bother setting hostname[255] = 0, since if gethostname() is successful, it will be null-terminated already (and if it's not successful we don't read the string now. llvm-svn: 228601
* Add missing include from r228592Ben Langmuir2015-02-091-0/+3
| | | | llvm-svn: 228594
* Add the hostname to the module hash to avoid sharing between hostsBen Langmuir2015-02-091-0/+10
| | | | | | | Sharing between hosts will cause problems for the LockFileManager, which can timeout waiting for a process that has already died. llvm-svn: 228592
* DebugInfo: Refactor default arg handling into a common place (instead of ↵David Blaikie2015-02-094-21/+18
| | | | | | handling in repeatedly for aggregate, complex, and scalar types) llvm-svn: 228591
* DebugInfo: Suppress the location of instructions in complex default arguments.David Blaikie2015-02-091-2/+8
| | | | llvm-svn: 228589
* DebugInfo: Suppress the location of instructions in aggregate default arguments.David Blaikie2015-02-091-0/+5
| | | | | | | | Matches the existing code for scalar default arguments. Complex default arguments probably need the same handling too (test/fix to that coming next). llvm-svn: 228588
* Sema: Don't give attribute alias vars with struct type an init exprDavid Majnemer2015-02-081-0/+2
| | | | | | | | | | We'd give the VarDecl a CXXConstructExpr even though it is annotated with an alias attribute. This would make us trip over sanity checking asserts. This fixes PR22493. llvm-svn: 228523
* clang-format: Correctly mark preprocessor lines in child blocks.Daniel Jasper2015-02-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | This prevents contracting: auto lambda = []() { int a = 2 #if A + 2 #endif ; }; into: auto lambda = []() { int a = 2 #if A + 2 #endif ; }; Which is obviously BAD. This fixes llvm.org/PR22496. llvm-svn: 228522
* CodeGen: Move DebugLocs.Benjamin Kramer2015-02-072-3/+3
| | | | | | | | It's slightly cheaper than copying it, if the DebugLoc points to replaceable metadata every copy is recorded in a DenseMap, moving reduces the peak size of that map. llvm-svn: 228492
* [modules] Treat friend declarations that are lexically within a dependentRichard Smith2015-02-076-24/+63
| | | | | | | context as anonymous for merging purposes. They can't be found by their names, so we merge them based on their position within the surrounding context. llvm-svn: 228485
* clang-format: Format Objective-C try blocks like all the other try blocks.Nico Weber2015-02-072-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: @try { // ... } @finally { // ... } Now: @try { // ... } @finally { // ... } This is consistent with how we format C++ try blocks and SEH try blocks. clang-format not doing this before was an implementation oversight. This is dependent on BraceBreakingStyle. The snippet above is with the Attach style. Style Stroustrip for example still results in the "Before:" snippet, which makes sense since other blocks (try, else) break after '}' too. llvm-svn: 228483
* Make the byte-shift SSE intrinsics emit vector shuffles which we know the ↵Filipe Cabecinhas2015-02-071-11/+48
| | | | | | | | | | | | | | | | backend can handle. Also removed unused builtins. Original patch by Andrea Di Biagio! Reviewers: craig.topper, nadav Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7199 llvm-svn: 228481
* [modules] Don't accidentally trigger deserialization from ↵Richard Smith2015-02-071-6/+6
| | | | | | DeclContext::noload_lookup. llvm-svn: 228475
* PR22405: don't lose implicit-deleted-ness across AST write / read.Richard Smith2015-02-061-14/+14
| | | | llvm-svn: 228464
* ASTUnit: Fix a name clash in GCC builds.Benjamin Kramer2015-02-061-2/+2
| | | | | | | Should fix the build. Looks like GCC 4.9 is using different scoping rules for range-based for loops. llvm-svn: 228424
* Inline asm IR input register constraints don't have early clobberEric Christopher2015-02-061-4/+3
| | | | | | | | modifiers on them. If we have a matching output constraint with an early clobber make sure we don't propagate that to the input constraint. llvm-svn: 228422
* ASTUnit: Use range-based for loops.Benjamin Kramer2015-02-062-92/+71
| | | | llvm-svn: 228420
* -iframework option should be forwarded to linkerSteven Wu2015-02-061-0/+6
| | | | | | | | | | | | | | | Summary: -iframework option is used to specified System framework path so the path specified should be passed to linker as -F option rdar://problem/18234544 Reviewers: bob.wilson Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7106 llvm-svn: 228413
* Revert "OpenCL: handle shift operator with vector operands"Tom Stellard2015-02-061-65/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit r228382. This breaks the following case: Reported by Jeroen Ketema: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150202/122961.html typedef __attribute__((ext_vector_type(3))) char char3; void foo() { char3 v = {1,1,1}; char3 w = {1,2,3}; w <<= v; } If I compile with: clang -x cl file.c Then an error is produced: file.c:10:5: error: expression is not assignable w <<= v; ~ ^ 1 error generated. llvm-svn: 228406
* Update APIs that return a pair of iterators to return an iterator_range instead.Benjamin Kramer2015-02-0615-143/+98
| | | | | | Convert uses of those APIs into ranged for loops. NFC. llvm-svn: 228404
* [PowerPC] Re-disable linker optimizations for nowBill Schmidt2015-02-061-0/+7
| | | | llvm-svn: 228402
* OpenCL: handle shift operator with vector operandsSameer Sahasrabuddhe2015-02-061-1/+65
| | | | | | | | | | | | | | | | | | | | Introduce a number of checks: 1. If LHS is a scalar, then RHS cannot be a vector. 2. Operands must be of integer type. 3. If both are vectors, then the number of elements must match. Relax the requirement for "usual arithmetic conversions": When LHS is a vector, a scalar RHS can simply be expanded into a vector; OpenCL does not require that its rank be lower than the LHS. For example, the following code is not an error even if the implicit type of the constant literal is "int". char2 foo(char2 v) { return v << 1; } Consolidate existing tests under CodeGenOpenCL, and add more tests under SemaOpenCL. llvm-svn: 228382
* [modules] If a module declares an entity and then imports another declarationRichard Smith2015-02-062-20/+55
| | | | | | | | | of that entity, ensure that the redeclaration chain is reordered properly on reload. Otherwise, the result of name lookup for that entity may point to an entity that is too old; if that's an injected friend name or the like, that can result in the name not being found at all. llvm-svn: 228371
* Preprocessor: support __BIGGEST_ALIGNMENT__ macroTim Northover2015-02-062-2/+6
| | | | | | | | | | | For compatibility with GCC (and because it's generally helpful information otherwise inaccessible to the preprocessor). This appears to be canonically the alignment of max_align_t (e.g. on i386, __BIGGEST_ALIGNMENT__ is 4 even though vector types will be given greater alignment). Patch mostly by Mats Petersson llvm-svn: 228367
* Fix \param in r228276. [-Wdocumentation]NAKAMURA Takumi2015-02-051-1/+1
| | | | llvm-svn: 228355
* [modules] Refactor: unify the code that picks which declaration goes into aRichard Smith2015-02-051-55/+46
| | | | | | name lookup table. llvm-svn: 228354
* Re-land r228258 and make clang-cl's /EHs- disable -fexceptions againReid Kleckner2015-02-053-36/+59
| | | | | | | | | | | After r228258, Clang started emitting C++ EH IR that LLVM wasn't ready to deal with, even when exceptions were disabled with /EHs-. This time, make /EHs- turn off -fexceptions while still emitting exceptional constructs in functions using __try. Since Sema rejects C++ exception handling constructs before CodeGen, landingpads should only appear in such functions as the result of a __try. llvm-svn: 228329
* clang-format: Fix assert triggering on carriage returns.Daniel Jasper2015-02-051-0/+3
| | | | llvm-svn: 228288
* PR22465: when performing list-initialization for a class type C, if we see anRichard Smith2015-02-053-23/+40
| | | | | | | | | | initializer of the form {x}, where x is of type C or a type derived from C, perform *non-list* initialization of the entity from x, but create a CXXConstructExpr that knows that we used list-initialization syntax. Plus some fixes to ensure we mangle correctly in this and related cases. llvm-svn: 228276
* [OPENMP] Initial codegen for 'single' directive.Alexey Bataev2015-02-053-2/+67
| | | | | | | | | | | | | | | | This patch emits the following code for the single directive: #pragma omp single <body> <----> if(__kmpc_single(...)) { <body> __kmpc_end_single(...); } Differential Revision: http://reviews.llvm.org/D7045 llvm-svn: 228275
* Various fixes to mangling of list-initialization.Richard Smith2015-02-054-19/+76
| | | | llvm-svn: 228274
* [OPENMP] Codegen for 'taskyield' directiveAlexey Bataev2015-02-053-2/+28
| | | | | | | | | For 'taskyield' directive emit call to kmp_int32 __kmpc_omp_taskyield(ident_t *, kmp_int32 global_tid, int end_part); runtime function call with end_part arg set to 0 (it is ignored). Differential Revision: http://reviews.llvm.org/D7047 llvm-svn: 228272
* Revert r228258.Nico Weber2015-02-052-46/+31
| | | | | | | | | It caused a chromium base unittest that tests throwing and catching SEH exceptions to fail (http://crbug.com/455488) and I suspect it might also be the cause of the chromium clang win 64-bit shared release builder timing out during compiles. So revert to see if that's true. llvm-svn: 228262
* Silence a warning.Sean Silva2015-02-051-1/+1
| | | | | | | | | /Users/Sean/pg/llvm/tools/clang/lib/CodeGen/CGException.cpp:1871:23: warning: unused variable 'Finally' [-Wunused-variable] if (SEHFinallyStmt *Finally = S.getFinallyHandler()) { ^ 1 warning generated. llvm-svn: 228255
* [PowerPC] Revert workaround for TLS linker bugBill Schmidt2015-02-051-7/+0
| | | | | | | | | | | | | | | | In r227480, Ulrich Weigand introduced a workaround for a linker optimization bug that can create mis-optimized code for accesses to general-dynamic or local-dynamic TLS variables. The linker optimization bug only occurred for Clang/LLVM because of some inefficient code being generated for these TLS accesses. I have recently corrected LLVM to produce the efficient code sequence expected by the linkers, so this workaround is no longer needed. Therefore this patch reverts r227480. I've tested that the previous bootstrap failure no longer occurs with the workaround reverted. llvm-svn: 228253
* [analyzer] Relax an assertion in VisitLvalArraySubscriptExprAnna Zaks2015-02-051-1/+3
| | | | | | | | | | | | The analyzer thinks that ArraySubscriptExpr cannot be an r-value (ever). However, it can be in some corner cases. Specifically, C forbids expressions of unqualified void type from being l-values. Note, the analyzer will keep modeling the subscript expr as an l-value. The analyzer should be treating void* as a char array (https://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Pointer-Arith.html). llvm-svn: 228249
* [analyzer] Do not crash in the KeychainAPI checker on user defined 'free()'.Anna Zaks2015-02-051-2/+10
| | | | llvm-svn: 228248
* [analyzer] Look for allocation site in the parent frames as well as the ↵Anna Zaks2015-02-053-26/+23
| | | | | | | | | | | | | current one. Instead of handling edge cases (mostly involving blocks), where we have difficulty finding an allocation statement, allow the allocation site to be in a parent node. Previously we assumed that the allocation site can always be found in the same frame as allocation, but there are scenarios in which an element is leaked in a child frame but is allocated in the parent. llvm-svn: 228247
* [analyzer] Don't skip analyzing the functions in preprocessed files.Anna Zaks2015-02-051-1/+1
| | | | | | | The change in main file detection ended up disabling the path-sensitive analysis of functions within preprocessed files. llvm-svn: 228246
* Fix crash on finally blocks that don't fall throughReid Kleckner2015-02-051-1/+9
| | | | llvm-svn: 228243
* Fix build break, these builtins don't existReid Kleckner2015-02-051-4/+1
| | | | llvm-svn: 228241
* Do the same IRgen for __builtin_pow* as for pow*Reid Kleckner2015-02-051-1/+7
| | | | | | There's no reason for these to be different. llvm-svn: 228240
* Driver: Stop forcing frame pointer usage on WindowsReid Kleckner2015-02-041-17/+39
| | | | | | | | | | | | | | | | | Previously, we would use a frame pointer by default on non-Linux OSs. On Linux, any optimization flags imply -fomit-frame-pointer. XCore always defaulted to -fomit-frame-pointer. Now x86 Windows matches our behavior on Linux. All other ISAs supported by Windows (ARM, x64) use xdata information, and frame pointers aren't useful. Frame pointers are now off by default for such targets, but can be forced via -fno-omit-frame-pointer and code using alloca(). In fact, on Win64 our frame-pointer prologue is not describable with UNWIND_INFO. This change is a workaround to avoid using the broken FP using prologue for most functions. This is PR22467. llvm-svn: 228236
* [modules] When using -E, we may try to merge decls despite having no SemaRichard Smith2015-02-042-14/+18
| | | | | | | | | | | object. In such a case, use the TU's DC for merging global decls rather than giving up when we find there is no TU scope. Ultimately, we should probably avoid all loading of decls when preprocessing, but there are other reasonable use cases for loading an AST file with no Sema object for which this is the right thing. llvm-svn: 228234
OpenPOWER on IntegriCloud