summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Use the actual class visibility for the ObjC EHTYPE global,John McCall2013-02-191-1/+1
| | | | | | | | not the global visibility mode. Noticed by inspection. llvm-svn: 175479
* Temporarily revert r175471 for more review.Bill Wendling2013-02-191-3/+0
| | | | llvm-svn: 175477
* Add a 'no-builtin' attribute if we do not want to simplify calls.Bill Wendling2013-02-181-0/+3
| | | | llvm-svn: 175471
* CodeGenFunction::CurFuncDecl can be NULL; fix crash introduced in r175386.Douglas Gregor2013-02-181-3/+3
| | | | llvm-svn: 175448
* Re-apply r174919 - smarter copy/move assignment/construction, with fixes forLang Hames2013-02-173-1/+375
| | | | | | | | | | | bitfield related issues. The original commit broke Takumi's builder. The bug was caused by bitfield sizes being determined by their underlying type, rather than the field info. A similar issue with bitfield alignments showed up on closer testing. Both have been fixed in this patch. llvm-svn: 175389
* [CodeGen] tighten objc ivar invariant.load attributionSaleem Abdulrasool2013-02-171-4/+25
| | | | | | | | | | | | | | | | | An ivar ofset cannot be marked as invariant load in all cases. The ivar offset is a lazily initialised constant, which is dependent on an objc_msgSend invocation to perform a fixup of the offset. If the load is being performed on a method implemented by the class then this load can safely be marked as an inviarant because a message must have been passed to the class at some point, forcing the ivar offset to be resolved. An additional heuristic that can be used to identify an invariant load would be if the ivar offset base is a parameter to an objc method. However, without the parameters available at hand, this is currently not possible. Reviewed-by: John McCall <rjmccall@apple.com> Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> llvm-svn: 175386
* Emit vtables for an extern template class as available_externally, not asRichard Smith2013-02-161-8/+10
| | | | | | | linkonce_odr. Emit construction vtables as internal in this case, since the ABI does not guarantee that they will be availble externally. llvm-svn: 175330
* Add the 'target-cpu' and 'target-features' attributes to functions.Bill Wendling2013-02-151-0/+13
| | | | | | | The back-end will use these values to reconfigure code generation for different features. llvm-svn: 175308
* Abstract out emitting the vdtor calls and do it properly when using -cxx-abi ↵Timur Iskhodzhanov2013-02-154-12/+74
| | | | | | microsoft; also fix vdtor calls for the ARM ABI llvm-svn: 175271
* Revert accidental commit.Bill Wendling2013-02-141-13/+0
| | | | llvm-svn: 175143
* Pass the target options through to code generation.Bill Wendling2013-02-145-10/+31
| | | | | | | The code generation stuff is going to set attributes on the functions it generates. To do that it needs the target options. Pass them through. llvm-svn: 175141
* ubsan: Add checking for invalid downcasts. Per [expr.static.cast]p2 and p11,Richard Smith2013-02-134-5/+42
| | | | | | | base-to-derived casts have undefined behavior if the object is not actually an instance of the derived type. llvm-svn: 175078
* Emit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058Timur Iskhodzhanov2013-02-136-27/+121
| | | | llvm-svn: 175045
* Properly assemble PHIs after a null-checked invoke of objc_msgSend.John McCall2013-02-121-40/+67
| | | | | | rdar://12046763 llvm-svn: 174946
* Call __cxa_begin_catch with the current exception beforeJohn McCall2013-02-121-3/+69
| | | | | | calling std::terminate(). rdar://11904428 llvm-svn: 174940
* Change some CGF parameters to CGMs.John McCall2013-02-121-49/+49
| | | | llvm-svn: 174939
* Backing out r174919 while I investigate a self-host bug on Takumi's builder.Lang Hames2013-02-123-364/+1
| | | | llvm-svn: 174925
* In ARC, emit non-peepholed +1s within the full-expression insteadJohn McCall2013-02-121-17/+19
| | | | | | of immediately afterwards. llvm-svn: 174922
* When generating IR for default copy-constructors, copy-assignment operators,Lang Hames2013-02-113-1/+364
| | | | | | | | | | | | | | | | | | | | move-constructors and move-assignment operators, use memcpy to copy adjacent POD members. Previously, classes with one or more Non-POD members would fall back on element-wise copies for all members, including POD members. This often generated a lot of IR. Without padding metadata, it wasn't often possible for the LLVM optimizers to turn the element-wise copies into a memcpy. This code hasn't yet received any serious tuning. I didn't see any serious regressions on a self-hosted clang build, or any of the nightly tests, but I think it's important to get this out in the wild to get more testing. Insights, feedback and comments welcome. Many thanks to David Blaikie, Richard Smith, and especially John McCall for their help and feedback on this work. llvm-svn: 174919
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-1/+2
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-074-0/+9
| | | | | | restrictions. llvm-svn: 174601
* Changed CGObjCMac.cpp to add the marker externally_initialized to ↵Michael Gottesman2013-02-051-0/+2
| | | | | | | | | | | | | SELECTOR_REFERENCES in both the fragile and non-fragile API. This is to ensure that GlobalOpt in LLVM does not attempt to look through a selector reference to a method var name at compile time. I also added a test/updated old tests that need to recognize the new keyword. rdar://12580965. llvm-svn: 174461
* Fix typo in commentArnaud A. de Grandmaison2013-02-051-2/+2
| | | | llvm-svn: 174359
* CodeGen: Implement hint values for dynamic_cast as described in the Itanium ↵Benjamin Kramer2013-02-031-2/+59
| | | | | | | | | | | | | | | C++ ABI. This can yield dramatic speedups of dynamic_cast for simple inheritance trees, at least with libsupc++. Neither libcxxabi nor libcxxrt make use of this hint currently, it was never implemented because clang didn't support it. There was some concern about the number of class hierarchy walks this change introduces. If it turns out to be an issue we can add caching either at the cast pair level or even deeper, but we also do a lot of walks in Sema so this codepath is probably fairly optimized already. llvm-svn: 174293
* CodeGen: Mark the runtime function __dynamic_cast as readonly & nounwind.Benjamin Kramer2013-02-031-5/+10
| | | | | | This allows the optimizer to CSE dynamic_casts. llvm-svn: 174289
* Don't forget to run destructors when we create an array temporary of class type.Richard Smith2013-02-021-8/+22
| | | | llvm-svn: 174257
* Fixed another whitespace issue... *sigh*.Michael Gottesman2013-02-021-3/+3
| | | | llvm-svn: 174255
* Fixed whitespace.Michael Gottesman2013-02-021-1/+1
| | | | llvm-svn: 174254
* On platforms which do not support ARC natively, do not mark ↵Michael Gottesman2013-02-021-4/+6
| | | | | | | | | objc_retain/objc_release as "nonlazybind". rdar://13108298. rdar://13129783. llvm-svn: 174253
* Revert r174246, accidentally committed.David Blaikie2013-02-024-20/+2
| | | | | | This reverts commit 1513eb9284c23acfd19cf742b95996fbb11ca741. llvm-svn: 174249
* Sentenc-ify comment added in r174206.David Blaikie2013-02-021-2/+2
| | | | | | Based on post-commit review by Paul Robinson. llvm-svn: 174248
* BasicsDavid Blaikie2013-02-024-2/+20
| | | | llvm-svn: 174246
* Fix exception handling line table problems introduced by r173593David Blaikie2013-02-013-8/+13
| | | | | | | | | | | | | r173593 made us a little too eager to associate all code at the end of a function with the user-written 'return' line. This caused problems with breakpoints as they'd be set in exception handling code preceeding the actual non-exception return handling code, leading to the breakpoint never being hit in non-exceptional execution. This change restores the pre-r173593 exception handling line information where the cleanup code is associated with the '}' not the return line. llvm-svn: 174206
* Destroy arrays and ARC fields when throwing out of ctors.John McCall2013-02-013-31/+20
| | | | | | | | Previously we were only handling non-array fields of class type. Testcases derived from a patch by WenHan Gu. llvm-svn: 174146
* Add support for AArch64 target.Tim Northover2013-01-314-5/+434
| | | | | | | | | | | | | In cooperation with the LLVM patch, this should implement all scalar front-end parts of the C and C++ ABIs for AArch64. This patch excludes the NEON support also reviewed due to an outbreak of batshit insanity in our legal department. That will be committed soon bringing the changes to precisely what has been approved. Further reviews would be gratefully received. llvm-svn: 174055
* [msan] Run more optimizations after MemorySanitizer pass.Evgeniy Stepanov2013-01-311-0/+12
| | | | | | | | | | | | MSan instrumentation is driven by the original code. We take every incoming instruction and emit another instruction (or ten) next to it, operating on the shadow values (but sometimes on the real values, too). Two programs in one, essentially. There can be any kinds of redundancies in the second one, so we just run whatever is normally run at -O2, and then exclude some passes that do not help much with benchmarks. llvm-svn: 174049
* When we're emitting a constructor or destructor call from a delegatingDouglas Gregor2013-01-314-21/+39
| | | | | | | constructor, retrieve our VTT parameter directly. Fixes PR14588 / <rdar://problem/12867962>. llvm-svn: 174042
* Make sure that the Attribute object represents one attribute only.Bill Wendling2013-01-315-22/+31
| | | | | | | | Several places were still treating the Attribute object as respresenting multiple attributes. Those places now use the AttributeSet to represent multiple attributes. llvm-svn: 174004
* Move UTF conversion routines from clang/lib/Basic to llvm/lib/SupportDmitri Gribenko2013-01-302-2/+4
| | | | | | This is required to use them in TableGen. llvm-svn: 173924
* Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled asRichard Smith2013-01-301-8/+6
| | | | | | an attribute for consistency with our other noreturn mechanisms. llvm-svn: 173898
* [ubsan] Implement the -fcatch-undefined-behavior flag using a trappingChad Rosier2013-01-293-3/+10
| | | | | | | | | | | implementation; this is much more inline with the original implementation (i.e., pre-ubsan) and does not require run-time library support. The trapping implementation can be invoked using either '-fcatch-undefined-behavior' or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error', with the latter being preferred. Eventually, the -fcatch-undefined-behavior' flag will be removed. llvm-svn: 173848
* Since ObjCARC has been refactored into its own library with its own ↵Michael Gottesman2013-01-281-0/+1
| | | | | | declaration header, we need to include the declaration header alongside Scalar.h in BackendUtil. llvm-svn: 173648
* Use the AttributeSet instead of AttributeWithIndex.Bill Wendling2013-01-273-36/+23
| | | | | | | In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the internals of the AttributeSet to outside users, which isn't goodness. llvm-svn: 173605
* PR14566: Debug Info: avoid top level lexical blocks in functionsDavid Blaikie2013-01-264-8/+21
| | | | | | | | | | | | | | | One of the gotchas (see changes to CodeGenFunction) was due to the fix in r139416 (for PR10829). This only worked previously because the top level lexical block would set the location to the end of the function, the debug location would be updated (as per r139416), the location would be set to the end of the function again (but that would no-op, since it was the same as the previous location), then the return instruction would be emitted using the debug location. Once the top level lexical block was no longer emitted, the end-of-function location change was causing the debug loc to be updated, regressing that bug. llvm-svn: 173593
* patch for PR9027 and // rdar://11861085Fariborz Jahanian2013-01-253-3/+22
| | | | | | | | | | | Title: [PR9027] volatile struct bug: member is not loaded at -O; This is caused by last flag passed to @llvm.memcpy being false, not honoring that aggregate has at least one 'volatile' data member (even though aggregate itself has not been qualified as 'volatile'. As a result, optimization optimizes away the memcpy altogether. Patch review by John MaCall (I still need to fix up a test though). llvm-svn: 173535
* ARM says that the array cookie should always be eight bytes.John McCall2013-01-251-25/+21
| | | | | | | ARM is not thinking about over-aligned structures. Overrule ARM in both our generic-ARM and iOS ABI implementations. llvm-svn: 173531
* Move the decision about the kind of CGCXXABI to make insideJohn McCall2013-01-253-13/+25
| | | | | | the family-specific files. llvm-svn: 173530
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-258-147/+214
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* First pass at abstracting out a class for the target C++ ABI.John McCall2013-01-253-7/+11
| | | | llvm-svn: 173514
* [mips] Do not emit i32 padding if target ABI is O32. This was causing backendAkira Hatanaka2013-01-241-1/+2
| | | | | | to pass floating point arguments to be passed in integer registers. llvm-svn: 173375
OpenPOWER on IntegriCloud