aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
AgeCommit message (Collapse)Author
2012-10-25-fcatch-undefined-behavior checking for appropriate vptr value: Clang ↵Richard Smith
CodeGen side. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166661 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25When we're devirtualizing a method call, make sure the method has the ↵Eli Friedman
correct IR type. Reported in the thread "devirtualisation appears to crash clang on covariant functions on ARM" on cfe-dev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166651 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Remove the HiddenWeakTemplateVTables CodeGen option. It's currently unused.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166561 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Clang now attempts to create a TargetMachine whenever a triple is given.Nadav Rotem
Many of our tests specify triples that are not built into clang. In this commit we allow clang to fail loading the triple if we are only using clang to emit llvm ir. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166543 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Add padding inreg registers to cause llvm to skip ecx when needed withRafael Espindola
the x86_fastcallcc calling convention. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166538 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Add inreg markers with the x86_fastcallcc calling convention.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166537 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Change EmitAssemblyHelper to create the target machine earlyNadav Rotem
and use it to initialize the TargetTransformInfo analysis pass. We need the TTI information for the loop vectorizer. rdar://12464901 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166532 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23Switch CodeGenOptions over to a .def file, like we do with LangOptions.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166497 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23Don't try to use inreg with 0 sized structs. Thanks to Eli for reporting theRafael Espindola
regression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166461 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-20Move private classes into anonymous namespaces.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166377 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-20DR1472: A reference isn't odr-used if it has preceding initialization,Richard Smith
initialized by a reference constant expression. Our odr-use modeling still needs work here: we don't yet implement the 'set of potential results of an expression' DR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166361 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19IRgen: Initialize TargetLoweringInfo with a triple.Daniel Dunbar
- We create two TargetLoweringInfo instances for different pass managers, and they weren't consistent (the one for codegen didn't have the right info). I'm not sure this mattered anywhere in practice. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166299 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19Fix handling of the regparm attribute in the presence of classes with copyRafael Espindola
constructors. When I first moved regparm support to TargetInfo.cpp I tried to isolate it in classifyArgumentTypeWithReg, but it is actually a lot easier to flip the code around and check for regparm at the end of the decision tree. Without this refactoring classifyArgumentTypeWithReg would have to duplicate the logic about when to use non-byval indirect arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166266 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19Reintroduce the TargetTransformInfo to the clang pass manager.Nadav Rotem
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166263 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18Fix up comment and invert order. Most simple check first.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166240 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18Add a new option for and disable column number information as thereEric Christopher
are no known current users of column info. Robustify and fix up a few tests in the process. Reduces the size of debug information by a small amount. Part of PR14106 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166236 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18Revert svn r165741 "Add TargetTransformInfo to the clang driver."Bob Wilson
Nadav's llvm change r165665 caused problems with an LTO bootstrap of clang, so I'm reverting it for now, along with follow-on patches like this one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166164 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17Revert r158009 since there are some uses of artificial functions inEric Christopher
debug info. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166109 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17Set a special flag in class metadata when an Objective-C classJohn McCall
has ivars that require destruction, but none that require anything except zero-initialization. This is common in ARC and (when true throughout a class hierarchy) permits the elimination of an unnecessary message-send during allocation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166088 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17Organize and rename the magic constants for class flags.John McCall
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166087 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17At -O0, prefer objc_storeStrong with a null new value to theJohn McCall
combination of a load+objc_release; this is generally better for tools that try to track why values are retained and released. Also use objc_storeStrong when copying a block (again, only at -O0), which requires us to do a preliminary store of null in order to compensate for objc_storeStrong's assign semantics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166085 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17"'Might as well make it static const.' -- John McCall" -- Michael ScottNico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166080 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16PR13684: Emit vtable entries for deleted functions as __cxa_deleted_function.David Blaikie
This is consistent/interoperable with GCC 4.7 (& __cxa_deleted_function isn't present in 4.4 - not sure when it got added, but you'll need something with that function available for this to work). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166069 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16Add pnaclcall convention to Native Client targets.Derek Schuff
Because PNaCl bitcode must be target-independent, it uses some different bitcode representations from other targets (e.g. byval and sret for structures). This means that without additional type information, it cannot meet some native ABI requirements for some targets (e.g. passing structures containing unions by value on x86-64). To allow generation of code which uses the correct native ABIs, we also support triples such as x86_64-nacl, which uses target-dependent IR (as opposed to le32-nacl, which uses byval and sret). To allow interoperation between the two types of code, this patch adds a calling convention attribute to be used in code compiled with the target-dependent triple, which will generate code using the le32-style bitcode. This calling convention does not need to be explicitly supported in the backend because it determines bitcode representation rather than native conventions (the backend just needs to undersand how to handle byval and sret for the Native Client OS). This patch implements __attribute__((pnaclcall)) to generate calls in bitcode according to the le32 bitcode conventions, an attribute which is accepted by any Native Client target, but issues a warning otherwise. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16ARM ABI: fix ABI alignment issues in varargs.Manman Ren
We generalize r166040 to handle ABI alignment issues for all types. rdar://12439123 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166052 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16ARM ABI: passing illegal vector types as varargs.Manman Ren
We expand varargs in clang and the call site is handled in the back end, it is hard to match exactly how illegal vectors are handled in the backend. Therefore, we legalize the illegal vector types in clang: if (Size <= 32), legalize to i32. if (Size == 64), legalize to v2i32. if (Size == 128), legalize to v4i32. if (Size > 128), use indirect. rdar://12439123 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166043 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16ARM ABI: fix ABI alignment issues when passing legal vector types as varargs.Manman Ren
We create an aligned temporary space and copy the content over from ap.cur to the temporary space. This is necessary if the natural alignment of the type is greater than the ABI alignment. rdar://12439123 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166040 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16When using a symbol with attribute weakref, search for it first andJoerg Sonnenberger
don't try the normal GetOrCreateLLVM. The latter could drop the weak atrtibute on the second reference, if there is no explicit declaration of the aliasee. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166032 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16GNUstep runtime version default to 1.6, generate correct property attributeDavid Chisnall
metadata. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166023 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16Transform pattern:Alexey Samsonov
if (CGM.getModuleDebugInfo()) DebugInfo = CGM.getModuleDebugInfo() into a call: maybeInitializeDebugInfo(); This is a simplification for a possible future fix of PR13942. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166019 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16Use the Attributes::get method which takes an AttrVal value directly to ↵Bill Wendling
simplify the code a bit. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166010 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165988 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.Nico Weber
See PR14013. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165962 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling
own class named AttrBuilder. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165961 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15[asan] make AddressSanitizer to be a FunctionPass instead of ModulePass. ↵Kostya Serebryany
clang part: for FunctionPass we need to run asan at a different point, otherwise it will run before inlining git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165937 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15Use enum values instead of magic numbers for indexing into the attribute list.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165925 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15Attributes RewriteBill Wendling
Convert the uses of the Attributes class over to the new format. The Attributes::get method call now takes an LLVM context so that the attributes object can be uniquified and stored. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15At -O0, emit an @llvm.trap() call at the end of a value-returning function whichRichard Smith
fails to return a value, to make debugging this issue easier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165914 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14Remove operator cast method in favor of querying with the correct method.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165900 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-14Use the Builder to create the stack alignment attribute.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165888 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-13"Implement" codegen support for __noop().Nico Weber
Eli discovered that __noop's sema behavior also needs some love. I filed PR14081 for that and intend to improve it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165886 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-13Simplify. Suggestion by Sean Silva.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12Make -mms-bitfields behave consistently.Eli Friedman
Patch by Jeremiah Zanin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165849 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12-fcatch-undefined-behavior: Trap undefined behavior due to conversions to orRichard Smith
from a floating-point type where the source value is not in the range of representable values of the destination type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165843 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12This patch addresses PR13948.Bill Schmidt
For 64-bit PowerPC SVR4, an aggregate containing only one floating-point field (float, double, or long double) must be passed in a register as though just that field were present. This patch addresses the issue during Clang code generation by specifying in the ABIArgInfo for the argument that the underlying type is passed directly in a register. The included test case verifies flat and nested structs for the three data types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165816 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Add TargetTransformInfo to the clang driver.Nadav Rotem
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165741 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Fix build failure from r165722Derek Schuff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165731 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Add in the first iteration of support for llvm/clang/lldb to allow variable ↵Micah Villmow
per address space pointer sizes to be optimized correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165726 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Properly factor Native Client defines to support NaCl as an OSDerek Schuff
with x86/ARM architecture git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165722 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Make X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32Derek Schuff
and Native Client git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165715 91177308-0d34-0410-b5e6-96231b3b80d8