summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Try to unbreak the Hexagon botDavid Majnemer2015-02-142-2/+2
| | | | llvm-svn: 229219
* DR1748: the reserved placement allocation functions have undefined behavior ifRichard Smith2015-02-141-3/+2
| | | | | | | they're given a null pointer as an argument, so we do not need to emit null checks on their results. llvm-svn: 229213
* CodeGen: _Atomic(_Complex) shouldn't crashDavid Majnemer2015-02-142-2/+8
| | | | | | | We could be a little kinder if we did a compare-exchange loop instead of an atomic-load/store pair. llvm-svn: 229212
* Revert "Revert r229082 for a bit, it caused PR22577."David Majnemer2015-02-146-13/+81
| | | | | | | This reverts commit r229123. It was a red herring, the bug was present without r229082. llvm-svn: 229205
* CodeGen: Correctly convert atomic bool from i8 to i1David Majnemer2015-02-141-1/+1
| | | | | | | | | Bools are a little tricky, they are i8 in memory and must be coerced back to i1 before further operations can be performed on them. This fixes PR22577. llvm-svn: 229204
* Revert r229082 for a bit, it caused PR22577.Nico Weber2015-02-136-81/+13
| | | | llvm-svn: 229123
* [PM] Fix #include order here that I forgot to update before changing it.Chandler Carruth2015-02-131-1/+1
| | | | llvm-svn: 229092
* [PM] Move away from the old llvm/PassManager.h header and its usingChandler Carruth2015-02-131-22/+22
| | | | | | | | | | | | declarations and just use the legacy namespace qualifier in this file and the permanent header name. The old wrapper header is going away to make LLVM's build more modular, and without updating Clang I can't easily start to add usage of the new pass manager to Clang. This should make it more clear in the code which set of types is doing what. llvm-svn: 229090
* MS ABI: Implement /volatile:msDavid Majnemer2015-02-136-13/+81
| | | | | | | | | | | | The /volatile:ms semantics turn volatile loads and stores into atomic acquire and release operations. This distinction is important because volatile memory operations do not form a happens-before relationship with non-atomic memory. This means that a volatile store is not sufficient for implementing a mutex unlock routine. Differential Revision: http://reviews.llvm.org/D7580 llvm-svn: 229082
* SEH: Use the SEHTryEpilogueStack instead of a separate boolReid Kleckner2015-02-124-10/+7
| | | | | | We don't need a bool to track this now that we have a stack for it. llvm-svn: 228982
* [ms] Implement codegen for __leave.Nico Weber2015-02-123-4/+21
| | | | | | Reviewed at http://reviews.llvm.org/D7575 llvm-svn: 228977
* Fix typoo.Richard Smith2015-02-123-5/+5
| | | | llvm-svn: 228963
* Add InlineAsmDiagnosticHandler for bitcode inputSteven Wu2015-02-121-0/+8
| | | | | | | | | | | | | | | | | | | | Summary: This patch installs an InlineAsmDiagnosticsHandler to avoid the crash report when the input is bitcode and the bitcode contains invalid inline assembly. The handler will simply print the same error message that will print from the backend. Add CHECK in test-case Reviewers: echristo, rafael Reviewed By: rafael Subscribers: rafael, cfe-commits Differential Revision: http://reviews.llvm.org/D7568 llvm-svn: 228898
* Wrap to 80 columns. No behavior change.Nico Weber2015-02-112-4/+7
| | | | llvm-svn: 228880
* Add the 'noinline' attribute to call sites within __try bodiesReid Kleckner2015-02-114-2/+16
| | | | | | | LLVM doesn't support non-call exceptions, so inlining makes it harder to catch such asynchronous exceptions. llvm-svn: 228876
* Add a comdat to __clang_call_terminateReid Kleckner2015-02-111-0/+2
| | | | llvm-svn: 228863
* Fix PR19351. While building up a composite type it is important to useAdrian Prantl2015-02-111-28/+29
| | | | | | | | | | | a non-uniqueable temporary node that is only turned into a permanent unique or distinct node after it is finished. Otherwise an intermediate node may get accidentally uniqued with another node as illustrated by the testcase. Paired commit with LLVM. llvm-svn: 228855
* Emit landing pads for SEH even if nounwind is presentReid Kleckner2015-02-113-3/+8
| | | | | | | Disabling exceptions applies nounwind to lots of functions. SEH catches asynch exceptions, so emit the landing pad anyway. llvm-svn: 228769
* 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
* 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
* 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
* Re-land r228258 and make clang-cl's /EHs- disable -fexceptions againReid Kleckner2015-02-051-24/+32
| | | | | | | | | | | 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
* [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
* [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-051-22/+22
| | | | | | | | | 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
* 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
* Implement IRGen for SEH __finally and AbnormalTerminationReid Kleckner2015-02-044-15/+95
| | | | | | | | | | | Previously we would simply double-emit the body of the __finally block, but that doesn't work when it contains any kind of Decl, which we can't double emit. This fixes that by emitting the block once and branching into a shared code region and then branching back out. llvm-svn: 228222
* DebugInfo: Attribute cleanup code to the end of the scope, not the end of ↵David Blaikie2015-02-044-6/+6
| | | | | | | | | | | | | | | | | | the function. Now if you break on a dtor and go 'up' in your debugger (or you get an asan failure in a dtor) during an exception unwind, you'll have more context. Instead of all dtors appearing to be called from the '}' of the function, they'll be attributed to the end of the scope of the variable, the same as the non-exceptional dtor call. This doesn't /quite/ remove all uses of CurEHLocation (which might be nice to remove, for a few reasons) - it's still used to choose the location for some other work in the landing pad. It'd be nice to attribute that code to the same location as the exception calls within the block and to remove CurEHLocation. llvm-svn: 228181
* Allow to specify multiple -fsanitize-blacklist= arguments.Alexey Samsonov2015-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Allow user to provide multiple blacklists by passing several -fsanitize-blacklist= options. These options now don't override default blacklist from Clang resource directory, which is always applied (which fixes PR22431). -fno-sanitize-blacklist option now disables all blacklists that were specified earlier in the command line (including the default one). This change depends on http://reviews.llvm.org/D7367. Test Plan: regression test suite Reviewers: timurrrr Subscribers: cfe-commits, kcc, pcc Differential Revision: http://reviews.llvm.org/D7368 llvm-svn: 228156
* Preserve early clobber flag when using named registers in inline assembly.Daniel Sanders2015-02-041-4/+5
| | | | | | | | | | | | | | | | Summary: Named registers with the constraint "=&r" currently lose the early clobber flag and turn into "=r" when converted to LLVM-IR. This patch correctly passes it on. Reviewers: atanasyan Reviewed By: atanasyan Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7346 llvm-svn: 228143
* Sema: Add support for __declspec(restrict)David Majnemer2015-02-041-1/+1
| | | | | | | | | | __declspec(restrict) and __attribute(malloc) are both handled identically by clang: they are allowed to the noalias LLVM attribute. Seeing as how noalias models the C99 notion of 'restrict', rename the internal clang attribute to Restrict from Malloc. llvm-svn: 228120
* InstrProf: Update for LLVM API changeJustin Bogner2015-02-031-9/+7
| | | | | | Update for the API change in r228075 llvm-svn: 228076
* CodeGen: Copy-ctorm must obey the destination's alignment requirementDavid Majnemer2015-02-032-3/+15
| | | | | | | | We would synthesize memcpy intrinsics when emitting calls to trivial C++ constructors but we wouldn't take into account the alignment of the destination. llvm-svn: 228061
* SEH: Track users of __try so we can pick a per-func EH personalityReid Kleckner2015-02-031-22/+22
| | | | | | | | | | | | | | | | | | There are four major kinds of declarations that cause code generation: - FunctionDecl (includes CXXMethodDecl etc) - ObjCMethodDecl - BlockDecl - CapturedDecl This patch tracks __try usage on FunctionDecls and diagnoses __try usage in other decls. If someone wants to use __try from ObjC, they can use it from a free function, since the ObjC code will need an ObjC-style EH personality. Eventually we will want to look through CapturedDecls and track SEH usage on the parent FunctionDecl, if present. llvm-svn: 228058
* DebugInfo: Ensure calls to functions with default arguments which themselves ↵David Blaikie2015-02-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | have default arguments, still have locations. To handle default arguments in C++ in the debug info, we disable code updating the debug location during the emission of default arguments. This code was buggy in the case of default arguments which, themselves, have default arguments - the inner default argument would re-enable debug info when it was finished, but before the outer default argument was finished. This was already a bug, but got worse (because a crasher instead of just a quality bug) with the recent improvements to debug info line quality because... The ApplyDebugLocation scoped device would find the debug info disabled and not save any debug location. But then in ~ApplyDebugLocation it would find the debug info had been enabled and would then apply the no-location. Then the outer function call would be emitted without any location. That's bad. Arguably we could /also/ fix the ApplyDebugLocation to assert on this situation (where debug info was disabled in the ctor and enabled in the dtor, or the other way around) but this is at least the necessary fix regardless. (also, I imagine this disabling behavior might need to be in-place for CGExprComplex and CGExprAgg too, maybe... ?) And I seem to recall seeing some weird default arg stepping behavior recently which might be related to this too... I'll have to look into it. llvm-svn: 228053
* InstrProf: Remove CoverageMapping::HasCodeBefore, it isn't usedJustin Bogner2015-02-031-14/+11
| | | | llvm-svn: 228035
* CodeGen: Update for LLVM API change in r228030Duncan P. N. Exon Smith2015-02-032-3/+3
| | | | | | | The mock tags are no longer in `dwarf::LLVMConstants`; they're in `dwarf::Tag`. llvm-svn: 228032
* Address review feedback for r228003.Adrian Prantl2015-02-0310-36/+57
| | | | | | | - use named constructors - get rid of MarkAsPrologue llvm-svn: 228021
* Merge ArtificialLocation into ApplyDebugLocation and make a clearAdrian Prantl2015-02-0310-54/+58
| | | | | | | | | | | | | | | | distinction between the different use-cases. With the previous default behavior we would occasionally emit empty debug locations in situations where they actually were strictly required (= on invoke insns). We now have a choice between defaulting to an empty location or an artificial location. Specifically, this fixes a bug caused by a missing debug location when emitting C++ EH cleanup blocks from within an artificial function, such as an ObjC destroy helper function. rdar://problem/19670595 llvm-svn: 228003
* Add documentation to ApplyDebugLocation.Adrian Prantl2015-02-031-2/+4
| | | | llvm-svn: 228002
* MS ABI: Records with fields with required aligmnet shouldn't be commonDavid Majnemer2015-02-031-3/+19
| | | | llvm-svn: 227954
* InstrProf: Update for LLVM API changeJustin Bogner2015-02-031-10/+10
| | | | | | Update for the change in r227900. llvm-svn: 227901
* When generating llvm.used, we may need an addrspacecast instead of a bitcast.Justin Holewinski2015-02-021-2/+2
| | | | | | | | | | | | | | | | | | Summary: This is especially important for targets that use multiple address spaces, and commonly place global variables in address spaces other than zero. Fixes PR22383 Test Plan: New test case added: llvm-used.cu Reviewers: jingyue Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7345 llvm-svn: 227861
* The prefix 'Ms-' should be 'MS-'David Majnemer2015-02-021-1/+1
| | | | | | | Clang is otherwise consistent that Microsoft be abbreviated as MS, not Ms. llvm-svn: 227842
* MS ABI: Implement support for 'novtable'David Majnemer2015-02-022-1/+13
| | | | | | | | | | It is common for COM interface classes to be marked as 'novtable' to tell the compiler that constructors and destructors should not reference virtual function tables. This commit implements this feature in clang. llvm-svn: 227796
OpenPOWER on IntegriCloud