History log of /llvm-project/clang/lib/CodeGen/CGExprConstant.cpp (Results 226 – 250 of 538)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-3.1.0, llvmorg-3.1.0-rc3, llvmorg-3.1.0-rc2
# 2d7c57ec 30-Apr-2012 David Blaikie <dblaikie@gmail.com>

Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior in

Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

llvm-svn: 155808

show more ...


Revision tags: llvmorg-3.1.0-rc1
# 9ec1e48b 15-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk>

PR12226: don't generate wrong code if a braced string literal is used to
initialize an array of unsigned char. Outside C++11 mode, this bug was benign,
and just resulted in us emitting a constant whi

PR12226: don't generate wrong code if a braced string literal is used to
initialize an array of unsigned char. Outside C++11 mode, this bug was benign,
and just resulted in us emitting a constant which was double the required
length, padded with 0s. In C++11, it resulted in us generating an array whose
first element was something like i8 ptrtoint ([n x i8]* @str to i8).

llvm-svn: 154756

show more ...


# 5a125b40 30-Mar-2012 Eli Friedman <eli.friedman@gmail.com>

Missing piece of r153720: make sure the vtable pointer is handled correctly.

llvm-svn: 153721


# a154dd5b 30-Mar-2012 Eli Friedman <eli.friedman@gmail.com>

ConstStructBuilder: fix offset math for base classes so it works correctly in general. Found by inspection.

llvm-svn: 153720


# effcd47e 09-Mar-2012 Eli Friedman <eli.friedman@gmail.com>

Make sure constant emission handles initializer lists with strings correctly. Part of <rdar://problem/10957867>.

llvm-svn: 152370


# bc638767 02-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk>

Reinstate r151879, r151880, reverted in r151922, along with a bugfix for
scalar emission of DeclRefExprs to const bools: emit scalar bools as i1,
not as i8.

In addition to the extra unit testing, th

Reinstate r151879, r151880, reverted in r151922, along with a bugfix for
scalar emission of DeclRefExprs to const bools: emit scalar bools as i1,
not as i8.

In addition to the extra unit testing, this has successfully bootstrapped.

llvm-svn: 151955

show more ...


# 4a7eab25 25-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at>

CodeGen support for global variables of type std::initializer_list<X>.

This emits a backing array with internal linkage and fills it with data,
then has the initializer_list point at the array. Dyna

CodeGen support for global variables of type std::initializer_list<X>.

This emits a backing array with internal linkage and fills it with data,
then has the initializer_list point at the array. Dynamic initialization
and global destructors are correctly supported.

What doesn't work is nested initializer_lists. I have no idea how to
get them to work, either. However, these should be very rare, and so
I'll just call it a known bug and declare generalized initializers
DONE!

llvm-svn: 151457

show more ...


# c8998924 23-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk>

PR12067: When emitting an evaluated constant structure in C++11 mode, don't
forget the vptrs.

llvm-svn: 151245


# ed90df38 22-Feb-2012 Douglas Gregor <dgregor@apple.com>

Generate an AST for the conversion from a lambda closure type to a
block pointer that returns a block literal which captures (by copy)
the lambda closure itself. Some aspects of the block literal are

Generate an AST for the conversion from a lambda closure type to a
block pointer that returns a block literal which captures (by copy)
the lambda closure itself. Some aspects of the block literal are left
unspecified, namely the capture variable (which doesn't actually
exist) and the body (which will be filled in by IRgen because it can't
be written as an AST).

Because we're switching to this model, this patch also eliminates
tracking the copy-initialization expression for the block capture of
the conversion function, since that information is now embedded in the
synthesized block literal. -1 side tables FTW.

llvm-svn: 151131

show more ...


# e6c32e62 19-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at>

Refuse to compile global std::initializer_lists instead of doing completely the wrong thing.

llvm-svn: 150928


# c62bb391 15-Feb-2012 John McCall <rjmccall@apple.com>

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 <benny.kra@googlemail.com>

Use a simpler (and more efficient) pattern to pad vectors.

llvm-svn: 150475


# 6331c408 13-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk>

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 <isanbard@gmail.com>

Bump up the initial vector size to avoid having to grow the vector more often.

llvm-svn: 149945


# ece0409a 07-Feb-2012 Chris Lattner <sabre@nondot.org>

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 <isanbard@gmail.com>

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 <isanbard@gmail.com>

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 <isanbard@gmail.com>

Don't recalculate the size of the array each time through the for-loop.

llvm-svn: 149933


# 72977a18 06-Feb-2012 Chris Lattner <sabre@nondot.org>

simplify code and smallvectorize.

llvm-svn: 149915


# 9c81833c 05-Feb-2012 Chris Lattner <sabre@nondot.org>

reapply the patches reverted in r149477, which enable ConstantDataArray.

llvm-svn: 149801


# a11b35a9 01-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com>

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 <sabre@nondot.org>

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 <richard-llvm@metafoo.co.uk>

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 <csdavec@swan.ac.uk>

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 <richard-llvm@metafoo.co.uk>

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 ...


12345678910>>...22