summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [multiversion] Update Clang for the API change in LLVM r227731.Chandler Carruth2015-02-011-6/+9
| | | | | | | | | | | This moves all of the PassManager <-> Target communication to use the new pass manager's TargetIRAnalysis even with the old pass manager. See the LLVM commit for some of why things are moving in this direction, but the short version is that this will enable us to create per-function TargetTransformInfo objects that have correct subtarget information for that function. llvm-svn: 227732
* [PM] Update Clang for the new LLVM API in r227685 for managing theChandler Carruth2015-01-311-9/+11
| | | | | | TargetTransformInfo, and unify the code in a single place. llvm-svn: 227686
* DebugInfo: Fix line table for comparisons harder/better for the sake of C (& ↵David Blaikie2015-01-311-1/+5
| | | | | | the GDB buildbot) llvm-svn: 227663
* CodeGen: create a WindowsARMTargetCodeGenInfoSaleem Abdulrasool2015-01-301-0/+34
| | | | | | | | | Create a new TargetCodeGenInfo for Windows on ARM to permit annotating the functions with stack-probe-size (for /Gs and -mstack-probe-support) for generating the stack probe necessary for Windows targets. This will be used by the backend when lowering the frame to generate the stack probe appropriately. llvm-svn: 227641
* SEH: Don't jump to an unreachable continuation blockReid Kleckner2015-01-301-1/+2
| | | | | | | If both the __try and __except blocks do not return, we want to delete the continuation block as unreachable instead. llvm-svn: 227627
* MS ABI: Implement proper support for setjmpDavid Majnemer2015-01-291-0/+52
| | | | | | | | | | | | | | | | | | | On targets which use the MSVCRT, setjmp is a macro which expands to _setjmp or _setjmpex. _setjmp and _setjmpex have a secret, hidden argument which is not listed in the function prototype on X64 and WoA. This hidden argument always seems to be the frame pointer. _setjmpex isn't used on X86, _setjmp is magically replaced with a call to _setjmp3. The second argument is zero for 'normal' setjmp/longjmp pairs, otherwise it is a count of additional variadic arguments. This is used when setjmp appears inside of a try or __try. It is not safe to use a pointer to setjmp because _setjmp, _setjmpex and _setmp3 are not compatible with setjmp. llvm-svn: 227426
* Make a codegen warning a real warning instead of a getCustomDiagID().Nico Weber2015-01-291-5/+3
| | | | | | | Warnings shouldn't use getCustomDiagID(), since then they can't be disabled via a flag, can't be remapped, etc. llvm-svn: 227420
* Remove NaClX86_64TargetCodeGenInfo and NaClARMTargetCodeGenInfoDerek Schuff2015-01-291-34/+1
| | | | | | | | | | | | | | | | Summary: They just existed before to use NaCl's custom ABIInfos; now that those are gone, the custom TargetCodeGenInfos are no longer needed either. Test Plan: don't break the existing tests Reviewers: jvoung Subscribers: jfb, cfe-commits Differential Revision: http://reviews.llvm.org/D7234 llvm-svn: 227406
* Remove support for pnaclcall attributeDerek Schuff2015-01-282-60/+2
| | | | | | | | | | | | | | | | | | Summary: It was used for interoperability with PNaCl's calling conventions, but it's no longer needed. Also Remove NaCl*ABIInfo which just existed to delegate to either the portable or native ABIInfo, and remove checkCallingConvention which was now a no-op override. Reviewers: jvoung Subscribers: jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D7206 llvm-svn: 227362
* DebugInfo: Attribute implicit boolean tests to the expression being tested, ↵David Blaikie2015-01-282-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not to the outer use of that expression. This is half a fix for a GDB test suite failure that expects to start at 'a' in the following code: void func(int a) if (a && b) ... But instead, without this change, the comparison was assigned to '&&' (well, worse actually - because there was a chained 'a && b && c' and it was assigned to the second '&&' because of a recursive application of this bug) and then the load folded into the comparison so breaking on the function started at '&&' instead of 'a'. The other part of this needs to be fixed in LLVM where it's ignoring the location of the icmp and instead using the location of the branch instruction. The fix to the conditional operator is actually a no-op currently, because the conditional operator's location coincides with 'a' (the start of the conditional expression) but should probably be '?' instead. See the FIXME in the test case that mentions the ARCMigration tool failures when I tried to make that change. llvm-svn: 227356
* Update the doxygen comments in CGDebugInfo.h to follow the coding standards.Adrian Prantl2015-01-271-46/+46
| | | | llvm-svn: 227221
* Begin to teach clang about the PS4.Alex Rosenberg2015-01-271-0/+14
| | | | llvm-svn: 227194
* Don't generate llvm.expect intrinsics with -O0.Pete Cooper2015-01-261-1/+6
| | | | | | | | | | The backend won't run LowerExpect on -O0. In a debug LTO build, this results in llvm.expect intrinsics being in the LTO IR which doesn't know how to optimize them. Thanks to Chandler for the suggestion and review. Differential revision: http://reviews.llvm.org/D7183 llvm-svn: 227135
* Update for LLVM API change.Eric Christopher2015-01-261-3/+2
| | | | llvm-svn: 227114
* DebugInfo: Attribute calls to overloaded operators with the operator, not ↵David Blaikie2015-01-251-2/+0
| | | | | | the start of the whole expression llvm-svn: 227028
* DebugInfo: Use the preferred location rather than the start location for ↵David Blaikie2015-01-257-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expression line info This causes things like assignment to refer to the '=' rather than the LHS when attributing the store instruction, for example. There were essentially 3 options for this: * The beginning of an expression (this was the behavior prior to this commit). This meant that stepping through subexpressions would bounce around from subexpressions back to the start of the outer expression, etc. (eg: x + y + z would go x, y, x, z, x (the repeated 'x's would be where the actual addition occurred)). * The end of an expression. This seems to be what GCC does /mostly/, and certainly this for function calls. This has the advantage that progress is always 'forwards' (never jumping backwards - except for independent subexpressions if they're evaluated in interesting orders, etc). "x + y + z" would go "x y z" with the additions occurring at y and z after the respective loads. The problem with this is that the user would still have to think fairly hard about precedence to realize which subexpression is being evaluated or which operator overload is being called in, say, an asan backtrace. * The preferred location or 'exprloc'. In this case you get sort of what you'd expect, though it's a bit confusing in its own way due to going 'backwards'. In this case the locations would be: "x y + z +" in lovely postfix arithmetic order. But this does mean that if the op+ were an operator overload, say, and in a backtrace, the backtrace will point to the exact '+' that's being called, not to the end of one of its operands. (actually the operator overload case doesn't work yet for other reasons, but that's being fixed - but this at least gets scalar/complex assignments and other plain operators right) llvm-svn: 227027
* DebugInfo: Correct the line location of geps on array accessesDavid Blaikie2015-01-241-0/+1
| | | | llvm-svn: 227023
* InstrProf: Use an Optional instead of an out parameterJustin Bogner2015-01-241-32/+27
| | | | llvm-svn: 227015
* [PM] Update Clang to reflect the TLI API change in LLVM r226981.Chandler Carruth2015-01-241-8/+9
| | | | llvm-svn: 226982
* InstrProf: Use the stream when dumping countersJustin Bogner2015-01-231-1/+1
| | | | llvm-svn: 226968
OpenPOWER on IntegriCloud