aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen
AgeCommit message (Collapse)AuthorFilesLines
2013-02-07Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei4-0/+9
restrictions. llvm-svn: 174601
2013-02-05Changed CGObjCMac.cpp to add the marker externally_initialized to ↵Michael Gottesman1-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
2013-02-05Fix typo in commentArnaud A. de Grandmaison1-2/+2
llvm-svn: 174359
2013-02-03CodeGen: Implement hint values for dynamic_cast as described in the Itanium ↵Benjamin Kramer1-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
2013-02-03CodeGen: Mark the runtime function __dynamic_cast as readonly & nounwind.Benjamin Kramer1-5/+10
This allows the optimizer to CSE dynamic_casts. llvm-svn: 174289
2013-02-02Don't forget to run destructors when we create an array temporary of class type.Richard Smith1-8/+22
llvm-svn: 174257
2013-02-02Fixed another whitespace issue... *sigh*.Michael Gottesman1-3/+3
llvm-svn: 174255
2013-02-02Fixed whitespace.Michael Gottesman1-1/+1
llvm-svn: 174254
2013-02-02On platforms which do not support ARC natively, do not mark ↵Michael Gottesman1-4/+6
objc_retain/objc_release as "nonlazybind". rdar://13108298. rdar://13129783. llvm-svn: 174253
2013-02-02Revert r174246, accidentally committed.David Blaikie4-20/+2
This reverts commit 1513eb9284c23acfd19cf742b95996fbb11ca741. llvm-svn: 174249
2013-02-02Sentenc-ify comment added in r174206.David Blaikie1-2/+2
Based on post-commit review by Paul Robinson. llvm-svn: 174248
2013-02-02BasicsDavid Blaikie4-2/+20
llvm-svn: 174246
2013-02-01Fix exception handling line table problems introduced by r173593David Blaikie3-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
2013-02-01Destroy arrays and ARC fields when throwing out of ctors.John McCall3-31/+20
Previously we were only handling non-array fields of class type. Testcases derived from a patch by WenHan Gu. llvm-svn: 174146
2013-01-31Add support for AArch64 target.Tim Northover4-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
2013-01-31[msan] Run more optimizations after MemorySanitizer pass.Evgeniy Stepanov1-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
2013-01-31When we're emitting a constructor or destructor call from a delegatingDouglas Gregor4-21/+39
constructor, retrieve our VTT parameter directly. Fixes PR14588 / <rdar://problem/12867962>. llvm-svn: 174042
2013-01-31Make sure that the Attribute object represents one attribute only.Bill Wendling5-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
2013-01-30Move UTF conversion routines from clang/lib/Basic to llvm/lib/SupportDmitri Gribenko2-2/+4
This is required to use them in TableGen. llvm-svn: 173924
2013-01-30Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled asRichard Smith1-8/+6
an attribute for consistency with our other noreturn mechanisms. llvm-svn: 173898
2013-01-29[ubsan] Implement the -fcatch-undefined-behavior flag using a trappingChad Rosier3-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
2013-01-28Since ObjCARC has been refactored into its own library with its own ↵Michael Gottesman1-0/+1
declaration header, we need to include the declaration header alongside Scalar.h in BackendUtil. llvm-svn: 173648
2013-01-27Use the AttributeSet instead of AttributeWithIndex.Bill Wendling3-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
2013-01-26PR14566: Debug Info: avoid top level lexical blocks in functionsDavid Blaikie4-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
2013-01-25patch for PR9027 and // rdar://11861085Fariborz Jahanian3-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
2013-01-25ARM says that the array cookie should always be eight bytes.John McCall1-25/+21
ARM is not thinking about over-aligned structures. Overrule ARM in both our generic-ARM and iOS ABI implementations. llvm-svn: 173531
2013-01-25Move the decision about the kind of CGCXXABI to make insideJohn McCall3-13/+25
the family-specific files. llvm-svn: 173530
2013-01-25The standard ARM C++ ABI dictates that inline functions areJohn McCall8-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
2013-01-25First pass at abstracting out a class for the target C++ ABI.John McCall3-7/+11
llvm-svn: 173514
2013-01-24[mips] Do not emit i32 padding if target ABI is O32. This was causing backendAkira Hatanaka1-1/+2
to pass floating point arguments to be passed in integer registers. llvm-svn: 173375
2013-01-23Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly3-17/+21
operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. llvm-svn: 173254
2013-01-23Remove the last of uses that use the Attribute object as a collection of ↵Bill Wendling2-7/+12
attributes. Collections of attributes are handled via the AttributeSet class now. This finally frees us up to make significant changes to how attributes are structured. llvm-svn: 173229
2013-01-23Use the AttributeSet when adding multiple attributes and an Attribute::AttrKindBill Wendling2-4/+11
when adding a single attribute to the function. llvm-svn: 173211
2013-01-22Use the correct field to copy/dispose a __block variable.John McCall1-14/+41
We were previously hard-coding a particular field index. This was fine before (because we were obviously guaranteed the presence of a copy/dispose member) except for (1) alignment padding and (2) future extensions adding extra members to the header, such as the extended-layout pointer. Note that we only introduce the extended-layout pointer in the presence of structs. (We also seem to be introducing it even in the presence of an all-non-object layout, but that's a different potential issue.) llvm-svn: 173122
2013-01-21Have AttributeSet::getRetAttributes() return an AttributeSet instead of ↵Bill Wendling1-3/+4
Attribute. This further restricts the use of the Attribute class to the Attribute family of classes. llvm-svn: 173099
2013-01-21Make AttributeSet::getFnAttributes() return an AttributeSet instead of an ↵Bill Wendling1-6/+6
Attribute. This is more code to isolate the use of the Attribute class to that of just holding one attribute instead of a collection of attributes. llvm-svn: 173095
2013-01-21First step towards vftable generation with -cxx-abi microsoft PR13231Timur Iskhodzhanov1-1/+1
llvm-svn: 173035
2013-01-21CGDebugInfo.cpp: Fix a warning. [-Wunused-variable]NAKAMURA Takumi1-0/+1
llvm-svn: 173022
2013-01-21PR14472: Preserve qualifiers while unwrapping types for debug infoDavid Blaikie1-14/+9
Looks like r161368 fixed this for one case but not all. This change generalizes the solution over all the unwrapping cases. Now that preserving the qualifiers is done independent of the particular type being unwrapped I won't bother adding test cases for each one but at least demonstrate that this change was necessary & sufficient to fix the bug. llvm-svn: 173002
2013-01-20Add top-level Clang flag -f(no-)sanitize-address-zero-base-shadow that makes ↵Alexey Samsonov1-7/+11
AddressSanitizer use bottom of the address space for the shadow memory. On Linux it can be used with -fPIE/-pie to improve performance. llvm-svn: 172974
2013-01-20Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei10-0/+19
OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
2013-01-20The last of PR14471: Debug info support for inline in-class initializer for ↵David Blaikie1-4/+8
float static members llvm-svn: 172942
2013-01-19Emit the function type of member function pointer types the same as member ↵David Blaikie1-2/+9
functions. Adding the pseudo first parameter to a member function pointer's function type and mark it as artificial. Combined with a fix to GDB ( http://sourceware.org/bugzilla/show_bug.cgi?id=14998 ) this fixes gdb.cp/member-ptr.exp with Clang. llvm-svn: 172911
2013-01-19Re-sort all the headers. Lots of regressions have crept in here.Chandler Carruth1-1/+1
Manually fix the order of UnwrappedLineParser.cpp as that one didn't have its associated header as the first header. This also uncovered a subtle inclusion order dependency as CLog.h didn't include LLVM.h to pick up using declarations it relied upon. llvm-svn: 172892
2013-01-18Use the AttributeSet query method instead of the Attribute method.Bill Wendling1-1/+1
llvm-svn: 172849
2013-01-18[ubsan] Add support for -fsanitize-blacklistWill Dietz9-57/+78
llvm-svn: 172808
2013-01-17[IRgen] Update modules autolink metadata to use module flags (as now specifiedDaniel Dunbar1-10/+6
in the LangRef). llvm-svn: 172692
2013-01-17Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith1-1/+2
it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
2013-01-17objC block layout: Patch reorders block layout to Fariborz Jahanian1-7/+42
produce more inline layout metadata. // rdar://12752901 llvm-svn: 172683
2013-01-16Correct order of operands forwarding NEON vfma to LLVM fmaTim Northover1-1/+3
llvm-svn: 172650