| #
e6c32e62 |
| 19-Feb-2012 |
Sebastian Redl <[email protected]> |
Refuse to compile global std::initializer_lists instead of doing completely the wrong thing.
llvm-svn: 150928
|
| #
c62bb391 |
| 15-Feb-2012 |
John McCall <[email protected]> |
Split reinterpret_casts of member pointers out from CK_BitCast; this is general goodness because representations of member pointers are not always equivalent across member pointer types on all ABIs (
Split reinterpret_casts of member pointers out from CK_BitCast; this is general goodness because representations of member pointers are not always equivalent across member pointer types on all ABIs (even though this isn't really standard-endorsed).
Take advantage of the new information to teach IR-generation how to do these reinterprets in constant initializers. Make sure this works when intermingled with hierarchy conversions (although this is not part of our motivating use case). Doing this in the constant-evaluator would probably have been better, but that would require a *lot* of extra structure in the representation of constant member pointers: you'd really have to track an arbitrary chain of hierarchy conversions and reinterpretations in order to get this right. Ultimately, this seems less complex. I also wasn't quite sure how to extend the constant evaluator to handle foldings that we don't actually want to treat as extended constant expressions.
llvm-svn: 150551
show more ...
|
| #
8001f746 |
| 14-Feb-2012 |
Benjamin Kramer <[email protected]> |
Use a simpler (and more efficient) pattern to pad vectors.
llvm-svn: 150475
|
| #
6331c408 |
| 13-Feb-2012 |
Richard Smith <[email protected]> |
Deal with a horrible C++11 special case. If a non-literal type has a constexpr constructor, and that constructor is used to initialize an object of static storage duration such that all members and b
Deal with a horrible C++11 special case. If a non-literal type has a constexpr constructor, and that constructor is used to initialize an object of static storage duration such that all members and bases are initialized by constant expressions, constant initialization is performed. In this case, the object can still have a non-trivial destructor, and if it does, we must emit a dynamic initializer which performs no initialization and instead simply registers that destructor.
llvm-svn: 150419
show more ...
|
| #
7ac74724 |
| 07-Feb-2012 |
Bill Wendling <[email protected]> |
Bump up the initial vector size to avoid having to grow the vector more often.
llvm-svn: 149945
|
| #
ece0409a |
| 07-Feb-2012 |
Chris Lattner <[email protected]> |
simplify a bunch of code to use the well-known LLVM IR types computed by CodeGenModule.
llvm-svn: 149943
|
| #
9972958a |
| 07-Feb-2012 |
Bill Wendling <[email protected]> |
Use a more efficient container for these values. Also reserve space when using a std::vector.
llvm-svn: 149936
|
| #
1e375fa2 |
| 07-Feb-2012 |
Bill Wendling <[email protected]> |
Use a SmallVector instead of std::vector. This improves compilation time in 445.gobmk by ~1.7%.
llvm-svn: 149935
|
| #
bf21cace |
| 06-Feb-2012 |
Bill Wendling <[email protected]> |
Don't recalculate the size of the array each time through the for-loop.
llvm-svn: 149933
|
| #
72977a18 |
| 06-Feb-2012 |
Chris Lattner <[email protected]> |
simplify code and smallvectorize.
llvm-svn: 149915
|
| #
9c81833c |
| 05-Feb-2012 |
Chris Lattner <[email protected]> |
reapply the patches reverted in r149477, which enable ConstantDataArray.
llvm-svn: 149801
|
| #
a11b35a9 |
| 01-Feb-2012 |
Argyrios Kyrtzidis <[email protected]> |
Revert r149363 which was part a series of commits that were reverted in llvm commit 149470. This fixes test/CodeGen/PR3589-freestanding-libcalls.c.
Original log:
ConstantArray::get() (for strin
Revert r149363 which was part a series of commits that were reverted in llvm commit 149470. This fixes test/CodeGen/PR3589-freestanding-libcalls.c.
Original log:
ConstantArray::get() (for strings) is going away, use ConstantDataArray::getString instead.
Many instances of ConstantArray::get() could be moved to use more efficient ConstantDataArray methods that avoid a ton of intermediate Constant*'s for each element (e.g. GetConstantArrayFromStringLiteral). I don't plan on doing this in the short-term though.
llvm-svn: 149477
show more ...
|
| #
f4a4bec3 |
| 31-Jan-2012 |
Chris Lattner <[email protected]> |
ConstantArray::get() (for strings) is going away, use ConstantDataArray::getString instead.
Many instances of ConstantArray::get() could be moved to use more efficient ConstantDataArray methods tha
ConstantArray::get() (for strings) is going away, use ConstantDataArray::getString instead.
Many instances of ConstantArray::get() could be moved to use more efficient ConstantDataArray methods that avoid a ton of intermediate Constant*'s for each element (e.g. GetConstantArrayFromStringLiteral). I don't plan on doing this in the short-term though.
llvm-svn: 149363
show more ...
|
| #
dd5bdd8d |
| 17-Jan-2012 |
Richard Smith <[email protected]> |
Remove constant member pointer support from Expr-based constant emission now that APValue-based constant emission knows how to emit member pointers.
llvm-svn: 148336
|
| #
fa35df62 |
| 16-Jan-2012 |
David Chisnall <[email protected]> |
Some improvements to the handling of C11 atomic types:
- Add atomic-to/from-nonatomic cast types - Emit atomic operations for arithmetic on atomic types - Emit non-atomic stores for initialisation o
Some improvements to the handling of C11 atomic types:
- 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
show more ...
|
| #
dafff947 |
| 14-Jan-2012 |
Richard Smith <[email protected]> |
constexpr irgen: Add irgen support for APValue::Struct, APValue::Union, APValue::Array and APValue::MemberPointer. All APValue values can now be emitted as constants.
Add new CGCXXABI entry point fo
constexpr irgen: Add irgen support for APValue::Struct, APValue::Union, 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
show more ...
|
| #
c4b251dc |
| 10-Jan-2012 |
Eli Friedman <[email protected]> |
Implement the missing pieces of Evaluate for _Complex types. With that complete, remove some code from CGExprConstant which is no longer necessary. While I'm here, a couple minor tweaks to _Complex
Implement the missing pieces of Evaluate for _Complex types. With that 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
show more ...
|
| #
b1bc368c |
| 05-Jan-2012 |
Eli Friedman <[email protected]> |
Address Richard's review comments on r147561 (Evaluate support for address-of-label differences).
llvm-svn: 147631
|
| #
fd5e54da |
| 04-Jan-2012 |
Eli Friedman <[email protected]> |
Add an APValue representation for the difference between two address-of-label expressions. Add support to Evaluate and CGExprConstant for generating/handling them. Remove the special-case for such
Add an APValue representation for the difference between two 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
show more ...
|
| #
6e52514c |
| 27-Dec-2011 |
Richard Smith <[email protected]> |
constexpr: support for evaluation and codegen of typeid constants.
llvm-svn: 147290
|
| #
5c9cd7a8 |
| 22-Dec-2011 |
Eli Friedman <[email protected]> |
Fix a failure (which led to a crash) in constant emission code with vector compound literals.
llvm-svn: 147111
|
| #
dae858ac |
| 07-Dec-2011 |
Eli Friedman <[email protected]> |
Make sure we correctly zero-initialize unions containing a pointer to data member as the first field. PR11487.
llvm-svn: 146009
|
| #
2d988f0f |
| 22-Nov-2011 |
Richard Smith <[email protected]> |
Use static storage duration for file-scope compound literals, even when they appear in non-constant initializers in C++.
llvm-svn: 145087
|
| #
027bf11e |
| 17-Nov-2011 |
Richard Smith <[email protected]> |
Constant expression evaluation: add support for evaluation of member pointers and base-to-derived casts, and add proper handling of temporaries.
llvm-svn: 144926
|
|
Revision tags: llvmorg-3.0.0, llvmorg-3.0.0-rc4 |
|
| #
ce40ad67 |
| 12-Nov-2011 |
Richard Smith <[email protected]> |
Represent an APValue based on a Decl as that Decl, rather than a DeclRefExpr or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to static member functions and static data mem
Represent an APValue based on a Decl as that Decl, rather than a DeclRefExpr or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to static member functions and static data members are now emitted as constant expressions.
llvm-svn: 144468
show more ...
|