summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Add support for OpenCL 1.1 logical operations.Tanya Lattner2012-01-161-0/+33
| | | | llvm-svn: 148254
* Fixes a crash during constant folding of a switch and case Fariborz Jahanian2012-01-161-0/+10
| | | | | | | statement which has an unscoped case inside it. Patch by Aaron Ballman llvm-svn: 148243
* Some improvements to the handling of C11 atomic types:David Chisnall2012-01-167-18/+104
| | | | | | | | | | | | | | | | | | - Add atomic-to/from-nonatomic cast types - Emit atomic operations for arithmetic on atomic types - Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load - Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function. - Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it. Still to do: - Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg. - Add a signal fence builtin - Properly set the fenv state in atomic operations on floating point values - Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context) - Fix the many remaining corner cases llvm-svn: 148242
* De-virtualize getPreviousDecl() and getMostRecentDecl() when we knowDouglas Gregor2012-01-141-1/+1
| | | | | | | | | | | | we have a redeclarable type, and only use the new virtual versions (getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have that type information. This keeps us from penalizing users with strict type information (and is the moral equivalent of a "final" method). Plus, settle on the names getPreviousDecl() and getMostRecentDecl() throughout. llvm-svn: 148187
* Remove a redundant word.Zhongxing Xu2012-01-141-1/+1
| | | | llvm-svn: 148179
* constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,Richard Smith2012-01-149-223/+400
| | | | | | | | | | | | | | | | | | | | APValue::Array and APValue::MemberPointer. All APValue values can now be emitted as constants. Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other entrypoints dealing with constant member pointers are no longer necessary and will be removed in a later change. Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to VarDecl::evaluateValue. This performs caching and deals with the nasty cases in C++11 where a non-const object's initializer can refer indirectly to previously-initialized fields within the same object. Building the intermediate APValue object incurs a measurable performance hit on pathological testcases with huge initializer lists, so we continue to build IR directly from the Expr nodes for array and record types outside of C++11. llvm-svn: 148178
* A base subobject type doesn't make sense for unions; don't try to compute ↵Eli Friedman2012-01-131-1/+1
| | | | | | it. Based on patch by Yin Ma. Fixes PR11751. llvm-svn: 148093
* Formatting.Eric Christopher2012-01-121-1/+1
| | | | llvm-svn: 147989
* Formatting.Eric Christopher2012-01-121-1/+1
| | | | llvm-svn: 147988
* Take into account the pointer to an aggregate that is passed as a hiddenAkira Hatanaka2012-01-121-2/+6
| | | | | | argument when Offset is initialized. llvm-svn: 147986
* Call CodeGenTypes::ConvertType to get LLVM::Type*.Akira Hatanaka2012-01-121-25/+4
| | | | | | Remove function MipsABIInfo::GetFloatingPointTy. llvm-svn: 147985
* Fixed VLA code generation.Abramo Bagnara2012-01-111-14/+22
| | | | llvm-svn: 147933
* Remove switch/case statements and call GetFloatingPointTy() instead to get theAkira Hatanaka2012-01-101-13/+1
| | | | | | floating point type. llvm-svn: 147894
* Flatten float complex arguments. N32/64 requires float complex arguments beAkira Hatanaka2012-01-101-4/+28
| | | | | | passed in floating point registers. llvm-svn: 147892
* Remove space.Akira Hatanaka2012-01-101-2/+2
| | | | llvm-svn: 147889
* Add support for the androideabi environment to our triple support, andChandler Carruth2012-01-101-1/+1
| | | | | | | | | | for the arm-linux-androideabi triple in particular. Also use this to do a better job of selecting soft FP settings. Patch by Evgeniy Stepanov. llvm-svn: 147872
* Contrary to the other BSDs, NetBSD followed the ELF ABI for structureJoerg Sonnenberger2012-01-101-1/+0
| | | | | | passing on i386 and does not use registers. llvm-svn: 147856
* The `-fwritable-strings' flag doesn't make the backing store strings of allBill Wendling2012-01-101-10/+6
| | | | | | | | | | | CFStrings writable. The strings (both Unicode and ASCII) should reside in a read-only section. E.g., __TEXT,__cstring instead of __DATA,__data. This is done by making the global variable created for the strings constant despite the value of that flag. <rdar://problem/10657500> llvm-svn: 147845
* Implement the missing pieces of Evaluate for _Complex types. With that ↵Eli Friedman2012-01-101-30/+1
| | | | | | complete, remove some code from CGExprConstant which is no longer necessary. While I'm here, a couple minor tweaks to _Complex-in-C++. (Specifically, make _Complex types literal types, and don't warn for _Complex int.) llvm-svn: 147840
* objc++: patch for IRgen for atomic properties ofFariborz Jahanian2012-01-102-37/+164
| | | | | | | c++ objects with non-trivial assignment/copy functions. Also, one additional sema check. // rdar://6137845 llvm-svn: 147817
* Insert padding before unaligned long double arguments.Akira Hatanaka2012-01-091-13/+28
| | | | llvm-svn: 147791
* Move the piece of code up that skips the padding argument. Without this change,Akira Hatanaka2012-01-091-4/+4
| | | | | | padding insertion will not work if the coerced type is not a structure. llvm-svn: 147786
* objc++: more atomic property api code forFariborz Jahanian2012-01-082-12/+29
| | | | | | c++ object properties. wip. llvm-svn: 147750
* objc++: More codegen stuff for atomic properties of c++ objectsFariborz Jahanian2012-01-072-9/+22
| | | | | | with non-trivial copies. // rdar://6137845 llvm-svn: 147735
* Fixed TypeofExpr AST and code generation.Abramo Bagnara2012-01-071-5/+19
| | | | llvm-svn: 147730
* Add field PaddingType to ABIArgInfo which specifies the type of padding thatAkira Hatanaka2012-01-073-16/+55
| | | | | | | | is inserted before the real argument. Padding is needed to ensure the backend reads from or writes to the correct argument slots when the original alignment of a byval structure is unavailable due to flattening. llvm-svn: 147699
* objc++: more code gen stuff for atomic property api,Fariborz Jahanian2012-01-063-14/+77
| | | | | | | | currently turned off. // rdar://6137845 Also, fixes a test case which should be nonatomic under new API. llvm-svn: 147691
* Revert r147664; it's breaking clang regression tests.Eli Friedman2012-01-063-3/+3
| | | | llvm-svn: 147681
* Revert r147655; it's breaking the compiler_rt build on OSX.Eli Friedman2012-01-061-2/+1
| | | | llvm-svn: 147677
* objc++: some declarations related to atomicFariborz Jahanian2012-01-063-0/+34
| | | | | | | properties of c++ object types with non-trivial assignment copy. Not used yet. // rdar://6137845 llvm-svn: 147666
* Silence GCC warnings.Jakub Staszak2012-01-063-3/+3
| | | | llvm-svn: 147664
* If we are compiling with -fno-builtin then don't do constant folding ofDavid Chisnall2012-01-061-1/+2
| | | | | | | | builtins. This fixes PR11711. llvm-svn: 147655
* objc++: sythesize a helper function to be usedFariborz Jahanian2012-01-062-2/+91
| | | | | | | | for copying atomic properties of c++ objects with non-trivial copy assignment in setters/getters. Not yet used. // rdar://6137845 llvm-svn: 147636
* Address Richard's review comments on r147561 (Evaluate support for ↵Eli Friedman2012-01-051-1/+1
| | | | | | address-of-label differences). llvm-svn: 147631
* Fixes a code gen bug for setter code for a property ofFariborz Jahanian2012-01-051-1/+2
| | | | | | | | c++ object reference type with trivial copy constructor. This causes an assert crash and bad code gen. when assert is off. // rdar://6137845 llvm-svn: 147573
* Add an APValue representation for the difference between two ↵Eli Friedman2012-01-041-68/+26
| | | | | | | | | | address-of-label expressions. Add support to Evaluate and CGExprConstant for generating/handling them. Remove the special-case for such differences in Expr::isConstantInitializer. With that done, remove a bunch of buggy code from CGExprConstant for handling scalar expressions which is no longer necessary. Fixes PR11705. llvm-svn: 147561
* implement rdar://10639962 by keeping track of increased alignment Chris Lattner2012-01-041-1/+5
| | | | | | information even in subscripting operations. llvm-svn: 147557
* Restore r147493 and remove the part of the test that was checking the wrong ↵David Chisnall2012-01-041-6/+32
| | | | | | thing. llvm-svn: 147530
* Have functions return structures smaller than 128-bit in registers if ABIAkira Hatanaka2012-01-041-3/+54
| | | | | | is either N32 or N64. llvm-svn: 147520
* Revert r147493. It broke test/CodeGenObjC/constant-strings.m.Rafael Espindola2012-01-041-32/+6
| | | | llvm-svn: 147511
* Initialise constant Objective-C string isa pointers with a weak reference to ↵David Chisnall2012-01-031-6/+32
| | | | | | the class, so that they are usable in +load methods if the string class has been compiled with clang - if it's been compiled with GCC, the ABI makes this impossible. (GNU runtimes) llvm-svn: 147493
* Eliminate ObjCForwardProtocolDecl, which is redundant now thatDouglas Gregor2012-01-012-5/+6
| | | | | | ObjCProtocolDecl modules forward declarations properly. llvm-svn: 147415
* Introduce the core infrastructure needed to model redeclaration chainsDouglas Gregor2012-01-012-0/+13
| | | | | | | | | | | | | | | for Objective-C protocols, including: - Using the first declaration as the canonical declaration - Using the definition as the primary DeclContext - Making sure that all declarations have a pointer to the definition data, and that we know which declaration is the definition - Serialization support for redeclaration chains and for adding definitions to already-serialized declarations. However, note that we're not taking advantage of much of this code yet, because we're still re-using ObjCProtocolDecls. llvm-svn: 147410
* Unrevert r147271, reverted in r147361.Richard Smith2011-12-301-6/+7
| | | | | | | | | | | | Also temporarily remove the assumption from IR gen that we can emit IR for every constant we can fold, since it isn't currently true in C++11, to fix PR11676. Original comment from r147271: constexpr: perform zero-initialization prior to / instead of performing a constructor call when appropriate. Thanks to Eli for spotting this. llvm-svn: 147384
* Small refactoring and simplification of constant evaluation and some of itsRichard Smith2011-12-285-26/+20
| | | | | | clients. No functionality change. llvm-svn: 147318
* Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor2011-12-272-2/+0
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* constexpr: support for evaluation and codegen of typeid constants.Richard Smith2011-12-271-0/+9
| | | | llvm-svn: 147290
* Add intrinsics for lzcnt and tzcnt instructions.Craig Topper2011-12-251-0/+26
| | | | llvm-svn: 147263
* Fix a failure (which led to a crash) in constant emission code with vector ↵Eli Friedman2011-12-221-1/+2
| | | | | | compound literals. llvm-svn: 147111
* Unweaken vtables as per ↵David Blaikie2011-12-202-0/+11
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
OpenPOWER on IntegriCloud