History log of /external/clang/lib/CodeGen/CGExprConstant.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a4de17562d13d7a8188108243c4cfbd52f33229a 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r256229

http://b/26987366

(cherry picked from commit 87d948ecccffea9e9e37d0d053b246e2d6d6c47b)

Change-Id: I10ca401a280e905253aafabad9118693a2f24ffb
/external/clang/lib/CodeGen/CGExprConstant.cpp
b6d6993e6e6d3daf4d9876794254d20a134e37c2 01-Jul-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r239765

Change-Id: I0393bcc952590a7226af8c4b58534a8ee5fd2d99
/external/clang/lib/CodeGen/CGExprConstant.cpp
58878f85ab89b13e9eea4af3ccf055e42c557bc8 06-May-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r235153

Change-Id: Ia94bbcb6da7c75b6e7c2afedd1001094d62a7324
/external/clang/lib/CodeGen/CGExprConstant.cpp
3ea9e33ea25e0c2b12db56418ba3f994eb662c04 08-Apr-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r233350

Change-Id: I12d4823f10bc9e445b8b86e7721b71f98d1df442
/external/clang/lib/CodeGen/CGExprConstant.cpp
0e2c34f92f00628d48968dfea096d36381f494cb 23-Mar-2015 Stephen Hines <srhines@google.com> Update aosp/master clang for rebase to r230699.

Change-Id: I6a546ab3d4ae37119eebb735e102cca4f80ab520
/external/clang/lib/CodeGen/CGExprConstant.cpp
176edba5311f6eff0cad2631449885ddf4fbc9ea 01-Dec-2014 Stephen Hines <srhines@google.com> Update aosp/master Clang for rebase to r222490.

Change-Id: Ic557ac55e97fbf6ee08771c7b7c3594777b0aefd
/external/clang/lib/CodeGen/CGExprConstant.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/CodeGen/CGExprConstant.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/CodeGen/CGExprConstant.cpp
a53d7a0259ff88f78ba8ecac7d0cb3ea96302b1d 27-Sep-2013 Timur Iskhodzhanov <timurrrr@google.com> Abstract out the emission of vtables, add basic support for vtable emission when using -cxx-abi microsoft

Reviewed at http://llvm-reviews.chandlerc.com/D1532

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
fe16aa31fdfaad4c38aed443d853af293714f1c4 27-Sep-2013 David Majnemer <david.majnemer@gmail.com> AST: Handle qualified array types in typeid() expressions

The intent of getTypeOperand() was to yield an unqualified type.
However QualType::getUnqualifiedType() does not strip away qualifiers on
arrays.

N.B. This worked fine when typeid() was applied to an expression
because we would inject as implicit cast to the unqualified array type
in the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a5e660188a3c654cf0c88ed1093b28207e870b2b 20-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Make IgnoreParens() look through ChooseExprs.

This is the same way GenericSelectionExpr works, and it's generally a
more consistent approach.

A large part of this patch is devoted to caching the value of the condition
of a ChooseExpr; it's needed to avoid threading an ASTContext into
IgnoreParens().

Fixes <rdar://problem/14438917>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
21cde050b64eefbb5094af67985752eee42d00e2 17-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Make Expr::isConstantInitializer match IRGen.

Sema needs to be able to accurately determine what will be
emitted as a constant initializer and what will not, so
we get accurate errors in C and accurate -Wglobal-constructors
warnings in C++. This makes Expr::isConstantInitializer match
CGExprConstant as closely as possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
cd06f26835033e879a9278941f4f6e6a4086976d 26-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Rewrite record layout for ms_struct structs.

The old implementation of ms_struct in RecordLayoutBuilder was a
complete mess: it depended on complicated conditionals which didn't
really reflect the underlying logic, and placed a burden on users of
the resulting RecordLayout. This commit rips out almost all of the
old code, and replaces it with simple checks in
RecordLayoutBuilder::LayoutBitField.

This commit also fixes <rdar://problem/14252115>, a bug where class
inheritance would cause us to lay out bitfields incorrectly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7c3e615f01e8f9f587315800fdaf2305ed824568 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR12086, PR15117

Introduce CXXStdInitializerListExpr node, representing the implicit
construction of a std::initializer_list<T> object from its underlying array.
The AST representation of such an expression goes from an InitListExpr with a
flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr
containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr).

This more detailed representation has several advantages, the most important of
which is that the new MaterializeTemporaryExpr allows us to directly model
lifetime extension of the underlying temporary array. Using that, this patch
*drastically* simplifies the IR generation of this construct, provides IR
generation support for nested global initializer_list objects, fixes several
bugs where the destructors for the underlying array would accidentally not get
invoked, and provides constant expression evaluation support for
std::initializer_list objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
211c8ddb5b500ed84833751363d0cfe1115f4dd3 05-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Model temporary lifetime-extension explicitly in the AST. Use this model to
handle temporaries which have been lifetime-extended to static storage duration
within constant expressions. This correctly handles nested lifetime extension
(through reference members of aggregates in aggregate initializers) but
non-constant-expression emission hasn't yet been updated to do the same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c3bf52ced9652f555aa0767bb822ec4c64546212 21-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: Allow aggregates to have default initializers.

Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in
CXXCtorInitializers and in InitListExprs to represent a default initializer.

There's an additional complication here: because the default initializer can
refer to the initialized object via its 'this' pointer, we need to make sure
that 'this' points to the right thing within the evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
50f9de5d893694a7e46ba655ec9fce5dfeae9362 05-Apr-2013 Alexey Samsonov <samsonov@google.com> Allow EmitConstantInit() to emit constant initializers for objects with trivial constructors and non-trivial destructors. Test that such objects are ignored by init-order checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
41f3f3a4792f46787632fdb94f952f6b3ce3f4ae 05-Mar-2013 Jordan Rose <jordan_rose@apple.com> Silence a number of static analyzer warnings with assertions and such.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
19dbb20ac4371fae3190379a7e7bd467af3c00aa 23-Jan-2013 Joey Gouly <joey.gouly@arm.com> Add a new LangOpt NativeHalfType. This option allows for native half/fp16
operations (as opposed to storage only half/fp16).

Also add some semantic checks for OpenCL half types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
e6b9d802fb7b16d93474c4f1c179ab36202e8a8b 20-Jan-2013 Guy Benyei <guy.benyei@intel.com> Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
cfa88f893915ceb8ae4ce2f17c46c24a4d67502f 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c2316db5decd9cb7f8768ca67fad41fd8cffc110 11-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> c++ IRGen. In trivial cases that object is going into static
storage and thus is implicitly zero-initialized, no need to
do C++11 memory model. This patch unconditionally detects
such condition and zeroinitializer's the variable.
Patch has been commented on and OKed by Doug off-line.
// rdar://12897704


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
89e19b43b81a6b5d092a81d2ebf6ec9a4097a48d 03-Jan-2013 Eli Friedman <eli.friedman@gmail.com> Don't assert/crash on reference variables in lambdas bound to a
static local variable from the parent scope. PR14773.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3b844ba7d5be205a9b4f5f0b0d1b7978977f4b8c 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
reflect the migration in r171366.

Re-sort the #include lines to reflect the new paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5f608aedb6c5d32d2f7c51f9354a75b21f1eeaee 13-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Make -mms-bitfields behave consistently.

Patch by Jeremiah Zanin.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c5f804636e367ef744fd24cf88f7c956a5af0434 11-Oct-2012 Nico Weber <nicolasweber@gmx.de> Add codegen support for __uuidof().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
25a6a84cf5067b32c271e3ba078676dee838798d 08-Oct-2012 Micah Villmow <villmow@gmail.com> Move TargetData to DataLayout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1b5c336fc7b2013a619a50895d7a43f3f4334515 11-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove some redundancy from constant aggregate emission. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
45e4e086cf7b4552e806669825f5b2aa2368cc36 05-Sep-2012 Jin-Gu Kang <jaykang10@imrc.kist.re.kr> Changing of type checking order on InitListExpr
- UnionType is checked eariler than RecordType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a6c66cedc022c9e5d45a937d6b8cff491a6bf81b 31-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Change the representation of builtin functions in the AST
(__builtin_* etc.) so that it isn't possible to take their address.
Specifically, introduce a new type to represent a reference to a builtin
function, and a new cast kind to convert it to a function pointer in the
operand of a call. Fixes PR13195.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d4f5198ae07d9a4958d8191bac694ded12173ad9 04-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove get(V)BaseClassOffsetInBits, the CharUnit functions should be used instead.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5e2d5dec7736f6f9292d4212dec67295909f1328 23-Jun-2012 Hans Wennborg <hans@hanshq.net> Support the tls_model attribute (PR9788)

This adds support for the tls_model attribute. This allows the user to
choose a TLS model that is better than what LLVM would select by
default. For example, a variable might be declared as:

__thread int x __attribute__((tls_model("initial-exec")));

if it will not be used in a shared library that is dlopen'ed.

This depends on LLVM r159077.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
581deb3da481053c4993c7600f97acf7768caac5 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
262bc18e32500558af7cb0afa205b34bd37bafed 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 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)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
fe587201feaebc69e6d18858bea85c77926b6ecf 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 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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3754f9656ab6a4648e5264d891ad5fb2f94f2a1a 30-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Missing piece of r153720: make sure the vtable pointer is handled correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5fe61c6cb09a5a2d2ecddfb74f8b253d9d462165 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153720 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
8b42ab718d89ce458145118ec2071edd28b66a9a 09-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Make sure constant emission handles initializer lists with strings correctly. Part of <rdar://problem/10957867>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a3ca41f0c2bd1c4a752df88b283332f3b757d21e 03-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, this has successfully bootstrapped.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
19b1a6eb2c90fab7cefe74bea5b6de490b65ac9d 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. 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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c22adbd40ac2fc445e41fb664777179aa5c522e3 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
ac1303eca6cbe3e623fb5ec6fe7ec184ef4b0dfa 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 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
24fe798fffc1748d8bce1321af42981c3719cb85 19-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Refuse to compile global std::initializer_lists instead of doing completely the wrong thing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4d4e5c1ae83f4510caa486b3ad19de13048f9f04 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
(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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
14c598268ff7534d3753ae84eba9b8a81bf0bf8f 14-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Use a simpler (and more efficient) pattern to pad vectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7ca4850a3e3530fa6c93b64b740446e32c97f992 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 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
cf6511be740688c6fc554aaaeee1da9853b3c7df 07-Feb-2012 Bill Wendling <isanbard@gmail.com> Bump up the initial vector size to avoid having to grow the vector more often.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
8b418685e9e4f02f4eb2a76e1ec063e07552b68d 07-Feb-2012 Chris Lattner <sabre@nondot.org> simplify a bunch of code to use the well-known LLVM IR types computed by CodeGenModule.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f9ea953f22d8e50cae7fd541406d6f563ef86cda 07-Feb-2012 Bill Wendling <isanbard@gmail.com> Use a more efficient container for these values. Also reserve space when using a
std::vector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
35f18a5e8b5a434894a4886ed98f3dbaa3b895c0 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%.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
fd3e5ef640df089a1e717097cdb599eb9dd32ec4 07-Feb-2012 Bill Wendling <isanbard@gmail.com> Don't recalculate the size of the array each time through the for-loop.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
6ef016f87244aa8072394687e27b3b4fa0147028 06-Feb-2012 Chris Lattner <sabre@nondot.org> simplify code and smallvectorize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
94010695f7fce626e41ef045b60def9c912e9ce8 05-Feb-2012 Chris Lattner <sabre@nondot.org> reapply the patches reverted in r149477, which enable ConstantDataArray.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5d3a4bb13dfad72c89df09bce70351175ecd19dc 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 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
ff8f9ec8336c62b5e3504e2a394f4b25c0cb1963 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 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
e7aa62de659049428976052eadf69188eae64170 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7a7ee3033e44b45630981355460ef89efa0bdcc4 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 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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2d6a5670465cb3f1d811695a9f23e372508240d2 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 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7ead5c7b6fd48cf549e55b4db499c26ecf88ae75 10-Jan-2012 Eli Friedman <eli.friedman@gmail.com> 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.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5930a4c5224eea3b0558655f7f8c9ea027ef573e 06-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Address Richard's review comments on r147561 (Evaluate support for address-of-label differences).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
65639284118d54ddf2e51a05d2ffccda567fe246 05-Jan-2012 Eli Friedman <eli.friedman@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
47d2145675099893d702be4bc06bd9f26d8ddd13 27-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: support for evaluation and codegen of typeid constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
58c65fcb909c9c25d06507bcf41eb630b3d5e2da 22-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Fix a failure (which led to a crash) in constant emission code with vector compound literals.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
26e80cdfe8933a7f804e1d05b379d5ad50119db5 07-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Make sure we correctly zero-initialize unions containing a pointer to data member as the first field. PR11487.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146009 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7401cf524cdb7aad4951d8727d280f8b271af5a2 22-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Use static storage duration for file-scope compound literals, even when they
appear in non-constant initializers in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
e24f5fc8c763f1b5536b8d70dd510ca959db3a80 17-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: add support for evaluation of member pointers
and base-to-derived casts, and add proper handling of temporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1bf9a9e6a5bdc0de7939908855dcddf46b661800 12-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
180f47959a066795cc0f409433023af448bb0328 10-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for evaluation of structs and unions of
literal types, as well as derived-to-base casts for lvalues and
derived-to-virtual-base casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
cc5d4f637cdf83adc174b96d2bfe27cef1cf0f36 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: support for arrays.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7864435ef2bce200224120bd1df3aed98ea5b99a 07-Nov-2011 John McCall <rjmccall@apple.com> Rip out CK_GetObjCProperty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
64f45a24b19eb89ff88f7c3ff0df9be8e861ac97 01-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix the representation of wide strings in the AST and IR so that it uses the native representation of integers for the elements. This fixes a bunch of nastiness involving
treating wide strings as a series of bytes.

Patch by Seth Cantrell.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
51f4708c00110940ca3f337961915f2ca1668375 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
b000459901bc1c5a55246da83550ad427ad4c4ff 25-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Don't try to emit CK_LValueBitCast casts as constants. PR9558.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
aa4a99b4a62615db243f7a5c433169f2fc704420 15-Oct-2011 Anton Korobeynikov <asl@math.spbu.ru> Provide half floating point support as a storage only type.
Lack of half FP was a regression compared to llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2ed7cb649aa709b875c519f4a980a1e2b5712370 14-Oct-2011 Eli Friedman <eli.friedman@gmail.com> PR11124: Don't overwrite memory outside of a base class when performing zero-initialization before running its constructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a6b8b2c09610b8bc4330e948ece8b940c2386406 10-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation refactoring:
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
behaviour.
- Factor out evaluation of bitfield bit widths.
- Fix a few places which would evaluate an expression twice: once to determine
whether it is a constant expression, then again to get the value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
eb2d1f1c88836bd5382e5d7aa8f6b85148a88b27 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Removing a bunch of dead returns/breaks after llvm_unreachables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Switch assert(0/false) llvm_unreachable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0c706c29f20b6fa36759fa41333b9c3ec0bd2969 20-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Add list initialization for complex numbers in C. Essentially, this allows "_Complex float x = {1.0f, 2.0f};". See changes to docs/LanguageExtensions.html for a longer description.

<rdar://problem/9397672>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140090 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
33e56f3273457bfa22c7c50bc46cf5a18216863d 10-Sep-2011 John McCall <rjmccall@apple.com> Rename the ARC cast kinds to start with "ARC".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
dc05b11c67331016473fbc7909827b1b89c9616b 10-Sep-2011 John McCall <rjmccall@apple.com> When converting a block pointer to an Objective-C pointer type, extend
the lifetime of the block by copying it to the heap, or else we'll get
a dangling reference because the code working with the non-block-typed
object will not know it needs to copy.

There is some danger here, e.g. with assigning a block literal to an
unsafe variable, but, well, it's an unsafe variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1d9b3b25f7ac0d0195bba6b507a684fe5e7943ee 09-Sep-2011 John McCall <rjmccall@apple.com> Give conversions of block pointers to ObjC pointers a different cast kind
than conversions of C pointers to ObjC pointers. In order to ensure that
we've caught every case, add asserts to CastExpr that strictly determine
which cast kind is used for which kind of bit cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bcfd1f55bfbb3e5944cd5e03d07b343e280838c4 02-Sep-2011 Douglas Gregor <dgregor@apple.com> Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
85ea7aa961deac1d754f610af8062ae3f8b4e2a5 30-Aug-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Declare and define implicit move constructor and assignment operator.

This makes the code duplication of implicit special member handling even worse,
but the cleanup will have to come later. For now, this works.
Follow-up with tests for explicit defaulting and enabling the __has_feature
flag to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
dbff1a0dde2019f0a7688bf87656d6e5162912fa 23-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Cleanup to use helper.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a5c04344fa70d6eec34344760c1fe511e16f2d76 21-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2acc6e3feda5e4f7d9009bdcf8b1cd777fecfe2d 18-Jul-2011 Chris Lattner <sabre@nondot.org> de-constify llvm::Type, patch by David Blaikie!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
91a5755ad73c5dc1dfb167e448fdd74e75a6df56 15-Jul-2011 John McCall <rjmccall@apple.com> Create a new expression node, SubstNonTypeTemplateParmExpr,
to represent a fully-substituted non-type template parameter.
This should improve source fidelity, as well as being generically
useful for diagnostics and such.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
ef6de3da8572607f786303c07150daa6e140ab19 11-Jul-2011 Jay Foad <jay.foad@gmail.com> De-constify Types in StructType::get() and TargetData::getIntPtrType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7e5e5f4cc36fe50f46ad76dca7a266434c94f475 07-Jul-2011 John McCall <rjmccall@apple.com> In ARC, reclaim all return values of retainable type, not just those
where we have an immediate need of a retained value.

As an exception, don't do this when the call is made as the immediate
operand of a __bridge retain. This is more in the way of a workaround
than an actual guarantee, so it's acceptable to be brittle here.

rdar://problem/9504800



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
03e80030515c800d1ab44125b9052dfffd1bd04c 21-Jun-2011 Douglas Gregor <dgregor@apple.com> Introduce a new AST node describing reference binding to temporaries.

MaterializeTemporaryExpr captures a reference binding to a temporary
value, making explicit that the temporary value (a prvalue) needs to
be materialized into memory so that its address can be used. The
intended AST invariant here is that a reference will always bind to a
glvalue, and MaterializeTemporaryExpr will be used to convert prvalues
into glvalues for that binding to happen. For example, given

const int& r = 1.0;

The initializer of "r" will be a MaterializeTemporaryExpr whose
subexpression is an implicit conversion from the double literal "1.0"
to an integer value.

IR generation benefits most from this new node, since it was
previously guessing (badly) when to materialize temporaries for the
purposes of reference binding. There are likely more refactoring and
cleanups we could perform there, but the introduction of
MaterializeTemporaryExpr fixes PR9565, a case where IR generation
would effectively bind a const reference directly to a bitfield in a
struct. Addresses <rdar://problem/9552231>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c5cbb909e8a27deb8f1a2b6b7bf56a96051af81a 20-Jun-2011 Chris Lattner <sabre@nondot.org> Update to match mainline ConstantStruct::get API change. Also, use
ConvertType on InitListExprs as they are being converted. This is
needed for a forthcoming patch, and improves the IR generated anyway
(see additional type names in testcases).

This patch also converts a bunch of std::vector's in CGObjCMac to use
C arrays. There are a ton more that should be converted as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f85e193739c953358c865005855253af4f68a497 16-Jun-2011 John McCall <rjmccall@apple.com> Automatic Reference Counting.

Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
575a1c9dc8dc5b4977194993e289f9eda7295c39 20-May-2011 Douglas Gregor <dgregor@apple.com> Introduce Type::isSignedIntegerOrEnumerationType() and
Type::isUnsignedIntegerOrEnumerationType(), which are like
Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also
consider the underlying type of a C++0x scoped enumeration type.

Audited all callers to the existing functions, switching those that
need to also handle scoped enumeration types (e.g., those that deal
with constant values) over to the new functions. Fixes PR9923 /
<rdar://problem/9447851>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
855a8e79f42e670b405b31efd3963f4d89732aff 03-May-2011 Fariborz Jahanian <fjahanian@apple.com> Finish off rules for z-length bitfields in ms_struct
structs. // rdar://8823265


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
340fa242130c2d8d74c83edca0952e771aebe0e6 02-May-2011 Fariborz Jahanian <fjahanian@apple.com> More rule enforcement of zero bitfields for ms_struct.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
07a8a21c3376f3a2ee470bfa3549c6f3ac4e236d 29-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> ms_struct patch for initialization and field access irgen.
// rdar://8823265 - wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4423ac0282acb8ba801eb05b38712438dc0c1e3e 21-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For

double data[20000000] = {0};

we would blow out the memory by creating 20M Exprs to fill out the initializer.

To fix this, if the initializer list initializes an array with more elements than
there are initializers in the list, have InitListExpr store a single 'ArrayFiller' expression
that specifies an expression to be used for value initialization of the rest of the elements.

Fixes rdar://9275920.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f111d935722ed488144600cea5ed03a6b5069e8f 15-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> C1X: implement generic selections

As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
755d8497e39071aa24acc173ff07083e3256b8f8 12-Apr-2011 John McCall <rjmccall@apple.com> After some discussion with Doug, we decided that it made a lot more sense
for __unknown_anytype resolution to destructively modify the AST. So that's
what it does now, which significantly simplifies some of the implementation.
Normal member calls work pretty cleanly now, and I added support for
propagating unknown-ness through &.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
379b5155b4566f63679e1da6b0ceb5fdfa2aec6d 11-Apr-2011 John McCall <rjmccall@apple.com> More __unknown_anytype work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
575b374fdbfc2c2224fd3047ac11ffc4b8db9ae5 11-Apr-2011 Anders Carlsson <andersca@mac.com> Remove CK_DynamicToNull.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7d99bc37e77157523e3bfbc6c077842b74e6690f 10-Apr-2011 Anders Carlsson <andersca@mac.com> As a first step towards fixing PR9641, add a CK_DynamicToNull cast kind which
represents a dynamic cast where we know that the result is always null.

For example:

struct A {
virtual ~A();
};
struct B final : A { };
struct C { };

bool f(B* b) {
return dynamic_cast<C*>(b);
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1de4d4e8cb2e9c88809fea8092bc6e835a5473d2 07-Apr-2011 John McCall <rjmccall@apple.com> Basic, untested implementation for an "unknown any" type requested by LLDB.
The idea is that you can create a VarDecl with an unknown type, or a
FunctionDecl with an unknown return type, and it will still be valid to
access that object as long as you explicitly cast it at every use. I'm
still going back and forth about how I want to test this effectively, but
I wanted to go ahead and provide a skeletal implementation for the LLDB
folks' benefit and because it also improves some diagnostic goodness for
placeholder expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d06fea8580658470f92fb5d0d3d7ab5b475728dc 27-Mar-2011 Anton Yartsev <anton.yartsev@gmail.com> supported: AltiVec vector initialization with a single literal according to PIM section 2.5.1 - after initialization all elements have the value specified by the literal

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c4d68db1397b1c1a0a2fb33464dc65f9c51aec09 22-Mar-2011 Ken Dyck <kd@kendyck.com> Eliminate some literal '8's in FillInNullDataMemberPointers() by switching
to CharUnits. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
199c1891e9c5add7867f1eab0bf6e9dde0e7d1d9 19-Mar-2011 Ken Dyck <kd@kendyck.com> Use CharUnits's new increment operator. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4f318c080b5ea89e3f7407516fd8ed45b733b99d 19-Mar-2011 Ken Dyck <kd@kendyck.com> Replace literal '8's with CharWidth in AppendBitField. No change in
functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
207f4d8543529221932af82836016a2ef066c917 18-Mar-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for language-specific address spaces. On top of that,
add support for the OpenCL __private, __local, __constant and
__global address spaces, as well as the __read_only, _read_write and
__write_only image access specifiers. Patch originally by ARM;
language-specific address space support by myself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7d2f9d54bd99f4b4689cb386b51d1b066c883a9e 18-Mar-2011 Ken Dyck <kd@kendyck.com> Convert alignment values to CharUnits. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
15c152e4f042eb073ac05e87d588dd8fe3aa9e9e 18-Mar-2011 Ken Dyck <kd@kendyck.com> Convert getSizeInBytes() to getSizeInChars(), which returns its result in
CharUnits. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127846 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4a5c87ec3b92026523a6459f5b4547c4a9b5ab24 18-Mar-2011 Ken Dyck <kd@kendyck.com> Convert variables to CharUnits in ConvertStructToPacked(). No change in
functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127844 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
dc496395fb41c5f765045bfc6ed13d57be9a7b9f 17-Mar-2011 Ken Dyck <kd@kendyck.com> Convert NextOffsetInBytes to CharUnits and rename to NextOffsetInChars. No
change in functionality intended.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
17d12fec91098fd4946c3c3e4f45b84423027407 17-Mar-2011 Matt Beaumont-Gay <matthewbg@google.com> Politely inform GCC that we will never fall off the end of that switch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
8bba1f4ab1f06864fec627befdf7cf8e1ad017be 15-Mar-2011 John McCall <rjmccall@apple.com> Reorganize the emission of (unfoldable) constant casts a bit, and
make sure that upcasts of member pointer types are covered as constants.
Fixed rdar://problem/9130221



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
6925cc498be5d363ac7fb235dc6650fd7da5f2f2 15-Mar-2011 Ken Dyck <kd@kendyck.com> Introduce a CharUnits FieldOffsetInChars variable in AppendField() to
replace some uses of FieldOffsetInBytes. The remaining uses of
FieldOffsetInBytes will be replaced once NextFieldOffsetInBytes is converted
to CharUnits. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f004da49eae567b15240029cdd96617958c6b0c9 12-Mar-2011 Ken Dyck <kd@kendyck.com> Use CharUnits for argument passed to AppendPadding() from AppendBitField().
No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c29ea8fb903f9f7e3d8bdf8cb57b87eb3713826b 12-Mar-2011 Ken Dyck <kd@kendyck.com> Change parameter to AppendPadding from bytes to CharUnits. No change in
functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
106ca049e9a5b10ba80df1b60c0708b2491b7e18 11-Mar-2011 Ken Dyck <kd@kendyck.com> Convert the RecordSize parameter of AppendTailPadding() to CharUnits to
avoid converting to bits and back again. No change in functionality
intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0483a6fcf8a70f1dd900b634300510c7991a1c7c 02-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> Only emit string initializers in-place if types match. Fixes PR9373.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d8df5b65fc76c2f59148e1551f56a8ee26c9607b 17-Feb-2011 Chris Lattner <sabre@nondot.org> improve support for big endian targets, fixing PR8171, patch
by Heikki Kultala!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
9b7da1c46d6d2849f9cb51328d7fcddf2c417672 15-Feb-2011 John McCall <rjmccall@apple.com> Perform zero-initialization of virtual base classes when emitting
a zero constant for a complete class. rdar://problem/8424975

To make this happen, track the field indexes for virtual bases
in the complete object. I'm curious whether we might be better
off making CGRecordLayoutBuilder *much* more reliant on
ASTRecordLayout; we're currently duplicating an awful lot of the ABI
layout logic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
fb018d153cbf12fd2a4a278cbf7614b9a2e2835e 15-Feb-2011 Chris Lattner <sabre@nondot.org> update for ConstantVector API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
e69b09955acbde87470eea8bc99b580195569dc0 14-Feb-2011 Chris Lattner <sabre@nondot.org> revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125505 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1970d5fe94889a1c5ded3d821564363eb5c21020 14-Feb-2011 Chris Lattner <sabre@nondot.org> update for ConstantVector::get API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
dd76a9ab9ea675671200f94b18ce95766841952b 11-Feb-2011 Ken Dyck <kd@kendyck.com> Add a helper function, ASTContext::toBits(), that converts sizes in
CharUnits to sizes in bits, and use it to tidy up the places where the
conversion was done explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125332 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5f022d82696c84e4d127c558871d68ac6273274e 09-Feb-2011 Ken Dyck <kd@kendyck.com> Convert RecordLayout::Size to CharUnits from bits. No changes to
functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5808ce43f8d7e71f5acacc9ca320268c4f37565a 03-Feb-2011 John McCall <rjmccall@apple.com> More capturing of 'this': implicit member expressions. Getting that
right for anonymous struct/union members led to me discovering some
seemingly broken code in that area of Sema, which I fixed, partly by
changing the representation of member pointer constants so that
IndirectFieldDecls aren't expanded. This led to assorted cleanups with
member pointers in CodeGen, and while I was doing that I saw some random
other things to clean up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
9f71a8f4c7a182a5236da9e747d57cc1d1bd24c2 07-Dec-2010 Jay Foad <jay.foad@gmail.com> PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
ada4b32749458644272d90e34e4149c307376e59 22-Nov-2010 Anders Carlsson <andersca@mac.com> Refactor the null-initialization for record types and make it handle bases that aren't i8 arrays.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a14f5979572aa25c03d24750ee4724d2031d4ede 01-Nov-2010 Anders Carlsson <andersca@mac.com> Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
b6bbcc9995186799a60ce17d0c1acff31601653a 15-Oct-2010 John McCall <rjmccall@apple.com> Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4c40d98ab7acf5f27fa89b17bd8fc0ef7683df37 31-Aug-2010 John McCall <rjmccall@apple.com> Teach IR generation to return 'this' from constructors and destructors
under the ARM ABI.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2de56d1d0c3a504ad1529de2677628bdfbb95cd4 25-Aug-2010 John McCall <rjmccall@apple.com> GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0bab0cdab751248ca389a5592bcb70eac5d39260 23-Aug-2010 John McCall <rjmccall@apple.com> Abstract out everything having to do with member pointers into the ABI
class; they should just be completely opaque throughout IR gen now,
although I haven't really audited that.

Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f16aa103d3afd42fbca2ab346f191bf745cec092 22-Aug-2010 John McCall <rjmccall@apple.com> Go back to asking CodeGenTypes whether a type is zero-initializable.
Make CGT defer to the ABI on all member pointer types.
This requires giving CGT a handle to the ABI.
It's way easier to make that work if we avoid lazily creating the ABI.
Make it so.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d608cdb7c044365cf4e8764ade1e11e99c176078 22-Aug-2010 John McCall <rjmccall@apple.com> Experiment with using first-class aggregates to represent member function
pointers. I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
875ab10245d3bf37252dd822aa1616bb0a391095 22-Aug-2010 John McCall <rjmccall@apple.com> Abstract out member-pointer creation. I'm really unhappy about the current
duplication between the constant and non-constant paths in all of this.

Implement ARM ABI semantics for member pointer constants and conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
cf2c85e76fdafe7e634810a292321a6c8322483d 22-Aug-2010 John McCall <rjmccall@apple.com> Abstract more member-pointerness out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a7e6845660f91ec611427e1db842780e1ec12bdb 22-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Detabify.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3ec0bafda37da00aac370e24f9fff9efb90861d2 21-Aug-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Eliminate EmitPredefinedFunctionName(), it doesn't need to be factored out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f871d0cc377a1367b519a6cce26be74607566eba 07-Aug-2010 John McCall <rjmccall@apple.com> Store inheritance paths after CastExprs instead of inside them.
This takes some trickery since CastExpr has subclasses (and indeed,
is abstract).

Also, smoosh the CastKind into the bitfield from Expr.

Drops two words of storage from Expr in the common case of expressions
which don't need inheritance paths. Avoids a separate allocation and
another word of overhead in cases needing inheritance paths. Also has
the advantage of not leaking memory, since destructors for AST nodes are
never run.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f0ca0ee66e5b1f3fc4d98e0d8795fa92559ce491 18-Jul-2010 Eli Friedman <eli.friedman@gmail.com> Fix crash initializing a bit-field with a non-constant in a place where we
try to evaluate the initializer as a constant.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2bc00252d7597af32c84599076e4d14e678aaa8a 05-Jul-2010 Chris Lattner <sabre@nondot.org> fix PR7564 a cast where the bitfield struct init code
wasn't handling array padding elements right.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1880666c13b909f858ddec9c2a7784c5a0c04041 05-Jul-2010 Chris Lattner <sabre@nondot.org> AppendBitField really can never fail, so return its return value.
Everyone knows that no bugs are ever possible with bitfields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7f215c12af4c3e7f81b24102a676aabfdb4e1566 26-Jun-2010 Chris Lattner <sabre@nondot.org> use more efficient type comparison predicates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
e9a05b7fd6ece68310707d10bc747a702a9af4a8 03-Jun-2010 Anders Carlsson <andersca@mac.com> Don't try to explicitly zero out bit-fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c00129a08c829bb34f22dc13727043c994c85644 30-May-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR7040: Don't try to compute the LLVM type for a function where it
isn't possible to compute.

This patch is mostly refactoring; the key change is the addition of the code
starting with the comment, "Check whether the function has a computable LLVM
signature." The solution here is essentially the same as the way the
vtable code handles such functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0a87b377d9a8af87ebc99585be96aac2d36ccfcb 27-May-2010 Anders Carlsson <andersca@mac.com> When null-initializing bases with data member pointers, don't assert on virtual bases. Just initialize them to null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a83fb4bf8119b980ccf7de0795dff250a799ea58 18-May-2010 Anders Carlsson <andersca@mac.com> Correctly initialize bases with member pointers. This should fix PR6441 but that test case is a bit weird and I'd like to investigate further before closing that bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3e5af908ebf4c56b657c488bb2ca22f418e0868b 14-May-2010 Anders Carlsson <andersca@mac.com> Move ContainsPointerToDataMember to CodeGenTypes. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
32897fd3bd84e96d4bfa28aca0c7a907776fb855 03-May-2010 Anders Carlsson <andersca@mac.com> When computing the address of a virtual member function pointer, use the pointer width instead of hardcoding for 64-bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
e04d45e05277ee04997fe59b1d194503f484c846 24-Apr-2010 Anders Carlsson <andersca@mac.com> Get rid of the old GetNonVirtualBaseClassOffset and change all call sites to use the new version.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a75b71f967d7f090ef16a3d255baddbdce7ff81e 18-Apr-2010 Nuno Lopes <nunoplopes@sapo.pt> recommit r101568 to fix PR6766
as a side-effect, remove two FIXMEs now fixed

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
046c294a43024874ff35656c6e785b64e72f1f36 17-Apr-2010 Anders Carlsson <andersca@mac.com> Vtable -> VTable renames across the board.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7a22f02a02616be8fd817529f1696a88a35ee041 17-Apr-2010 Chris Lattner <sabre@nondot.org> revert r101568, which miscompiles this testcase, distilled from ldecod:

void exit_picture()
{
char yuv_types[4][6]= {"4:0:0","4:2:0","4:2:2","4:4:4"};
foo(yuv_types);
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
6784704d4715664adfa41277efc09f3ce46e7750 17-Apr-2010 Nuno Lopes <nunoplopes@sapo.pt> fix PR6766: codegen of var initialized with wide char

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d39a0d6119a3bf69e3e5149b778e825b77b2e06a 16-Apr-2010 Chris Lattner <sabre@nondot.org> fix a bogus assertion exposed by a recent change: packing the
struct may cause it to shrink more than one byte. Before
my recent changes we compiled the new test into:

%0 = type { [6 x i8] }
@x = global %0 { [6 x i8] undef }, align 2 ; <%0*> [#uses=0]

which is obviously bogus. Now we compile it into:

%0 = type <{ i32, i8, i8 }>
@x = global %0 zeroinitializer, align 2 ; <%0*> [#uses=0]

Where the last byte only is tail padding.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
cdb30b41590bf9e20d1d46a866fce071ebadf21a 16-Apr-2010 Nuno Lopes <nunoplopes@sapo.pt> emit padding as undef values, take 2
merge also a few tests I had here for this feature, and FileCheck'ize one file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101535 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
8ce9e451b421e4c941bc120bcc7f422457656d63 13-Apr-2010 Chris Lattner <sabre@nondot.org> Rework the ConstStructBuilder code to emit missing initializer
elements with explicit zero values instead of with tail padding.
On an example like this:

struct foo { int a; int b; };

struct foo fooarray[] = {
{1, 2},
{4},
};

We now lay this out as:

@fooarray = global [2 x %struct.foo] [%struct.foo { i32 1, i32 2 }, %struct.foo { i32 4, i32 0 }]

instead of as:

@fooarray = global %0 <{ %struct.foo { i32 1, i32 2 }, %1 { i32 4, [4 x i8] zeroinitializer } }>

Preserving both the struct type of the second element, but also the array type of the entire thing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
eba3e5af56b292f5c96fe50dbbd66bfdefc8d48c 13-Apr-2010 Chris Lattner <sabre@nondot.org> move a bunch of ConstStructBuilder methods out of line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0eea9f92b4972bbdf63a6ec97a2a85107c07d7ee 12-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6660/6168: emit padding as zeros instead of undef. Because
trailing fields may not be represented in initializer lists, they
are being handled as padding and those fields *must* be zero
initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
198bcb44b6271c92fd856403f34b518828100aac 31-Mar-2010 Daniel Dunbar <daniel@zuster.org> IRGen: Move the auxiliary data structures tracking AST -> LLVM mappings out of CodeGenTypes, to per-record CGRecordLayout structures.
- I did a cursory check that this was perf neutral, FWIW.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2924ade97ee4228fcf3518d89cd4bd1653236b48 31-Mar-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Move CGRecordLayout to its own happy little file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
af4403545a50a60d208e6fcae057308d576a92e0 23-Mar-2010 Anders Carlsson <andersca@mac.com> Rename CGVtableInfo to CodeGenVTables in preparation of adding another VTableInfo class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
da1826102fcadb5d3c5d2d20dfa51f0e77489004 04-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> really fix 6473 by handling weakref in constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c0f3df3245fa2737b459e198273762a27b76f75a 10-Feb-2010 Chris Lattner <sabre@nondot.org> hopefully silence a warning on the clang-i386-darwin9 tester.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
585fa68ca00421af6c8289866a7bde27a8e8c0ce 07-Feb-2010 Anders Carlsson <andersca@mac.com> Use the right type when taking the address of a non-virtual member function pointer. Fixes PR6258.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2ca4f633b21c65e1a4edc2405a768d7f5db564eb 05-Feb-2010 Anders Carlsson <andersca@mac.com> Fix the bug that was breaking self-host, and re-land the static ctor fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
90c1c58aa72fecb8c3211aa25d0ef726ca6bf876 05-Feb-2010 Douglas Gregor <dgregor@apple.com> Revert r95363 and r95375, which broke self-host.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
b054e3804ca95255ecbc4521af7d2626367de0cf 05-Feb-2010 Anders Carlsson <andersca@mac.com> Fix array initialization test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7d94a9503c90fd26cd41a5cae3831d79e334526f 05-Feb-2010 Anders Carlsson <andersca@mac.com> If a global initializer has a non-trivial destructor it can't be emitted as a constant (even if it has a trivial constructor).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
e8a81f7e8e26275d91c073bf908a7d6d246106c5 04-Feb-2010 Anders Carlsson <andersca@mac.com> Calculate offset correctly when taking the address of a virtual member function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
6d5a1c28593443f3973ef38f8fa042d59182412d 03-Feb-2010 Daniel Dunbar <daniel@zuster.org> Revert "Numerous changes to selector handling:", this breaks a whole bunch of
working code, for no apparent reason.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a8fa96e366ab36145a5500dd4fbea717c217f131 03-Feb-2010 David Chisnall <csdavec@swan.ac.uk> Numerous changes to selector handling:

- Don't use GlobalAliases with non-0 GEPs (GNU runtime) - this was unsupported and LLVM will be generating errors if you do it soon. This also simplifies the code generated by the GNU runtime a bit.

- Make GetSelector() return a constant (GNU runtime), not a load of a store of a constant.

- Recognise @selector() expressions as valid static initialisers (as GCC does).

- Add methods to GCObjCRuntime to emit selectors as constants (needed for using @selector() expressions as constants. These need implementing for the Mac runtimes - I couldn't figure out how to do this, they seem to require a load.

- Store an ObjCMethodDecl in an ObjCSelectorExpr so that we can get at the type information for the selector. This is needed for generating typed selectors from @selector() expressions (as GCC does). Ideally, this information should be stored in the Selector, but that would be an invasive change. We should eventually add checks for common uses of @selector() expressions. Possibly adding an attribute that can be applied to method args providing the types of a selector so, for example, you'd do something like this:

- (id)performSelector: __attribute__((selector_types(id, SEL, id)))(SEL)
withObject: (id)object;

Then, any @selector() expressions passed to the method will be check to ensure that it conforms to this signature. We do this at run time on the GNU runtime already, but it would be nice to do it at compile time on all runtimes.

- Made @selector() expressions emit type info if available and the runtime supports it.

Someone more familiar with the Mac runtime needs to implement the GetConstantSelector() function in CGObjCMac. This currently just assert()s.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
878b55ce6cbbf62461c796163f586cc75202f7d4 02-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Use the Arg variable rather than re-computing it. This also silences GCC's
unused variable warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
fb8b69aef3377aaa786d1278aaae7e7b04ac095f 02-Feb-2010 John McCall <rjmccall@apple.com> Codegen CXXConstructExprs with trivial constructors as constants.
Eliminates a lot of spurious global initializers, fixing PR6205.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2c12d0319a267b844cb7d569d84426cd344b90f7 02-Feb-2010 Anders Carlsson <andersca@mac.com> Improve handling of emitting 'null' pointers to data members.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
45147d0098a34c3705f74ca121b27d7736ac113a 02-Feb-2010 Anders Carlsson <andersca@mac.com> Move pointer to data member emission to CodeGenModule and use it in CGExprConstant. Fixes PR5674.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bb7e17b52ffaa4097b4c4d7935746d23539ffe2a 31-Jan-2010 Anders Carlsson <andersca@mac.com> Some class related cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0d13f6fdbdd6f06e2449b8834dda53334abd399a 23-Jan-2010 David Chisnall <csdavec@swan.ac.uk> Created __builtin___NSStringMakeConstantString() builtin, which generates constant Objective-C strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a73058324197b7bdfd19307965954f626e26199d 15-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Convert the type of the LValue offset variable in APValue to CharUnits, moving
the LValue-related methods of APValue out of line to avoid header file leaching.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7af4ec744e30d573482aef7a37089d0d32cc07ef 05-Jan-2010 Anders Carlsson <andersca@mac.com> When emitting member function pointers, use the canonical decl if the member function is virtual. Fixes PR5940.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
8ac5549e726f67c2d37647ecad6d543e71f82950 03-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Get rid of some unnecessary code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
88b172cd206aa94f8eab071787f4a7ec2442c407 08-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update CGExprConstant for change to emit padding values as undef.
- This fixes 2003-05-21-BitfieldHandling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
85b4521e34dcd4a0a4a1f0819e1123128e5a3125 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d6b07fb9ca2c3207773de1d8e305f99076598a2e 27-Nov-2009 Anders Carlsson <andersca@mac.com> Don't build the entire vtable when all we want is the index of a virtual method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
01a79acd9a5a701c7ddb46174ddfcb0e54349f4a 22-Nov-2009 Anders Carlsson <andersca@mac.com> Support emitting aggregate class initializers. Fixes PR5581.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
55f9bdd88c93b5c8dab631c0808f7f7a541cea14 14-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Avoid assert-crash in a case where the expression passed to EmitConstantExpr
legitimately has side-effects (and needs to be generated as a non-constant).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f70b24e7fa15d72506534af43d4090bb37a32694 14-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Make __func__ and friends work correctly within the initializer for a static
local variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
64241fc930e0b2247e8c5b5af9d48d13c4bec8ae 13-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Obvious fix for PR5474.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
41a124aba77e07ab6263239bdb3df6f5feb34e13 06-Nov-2009 Chris Lattner <sabre@nondot.org> indirectbr seems to work! Rip out the old code.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c6eb131a83eb35d0c896170652563449648a32c3 29-Oct-2009 Nuno Lopes <nunoplopes@sapo.pt> make clang emit undefs for padding of structs and unions instead of zeros. this enables constant compaction optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d9becd1846e2c72bf6ad283faa1b048f33dd3afe 29-Oct-2009 Chris Lattner <sabre@nondot.org> Implement clang support for indirect branch and address of label
using the new LLVM support for this. This is temporarily hiding
behind horrible and ugly #ifdefs until the time when the optimizer
is stable (hopefully a week or so). Until then, lets make it "opt in" :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a2813cec2605ce7878d1b13471d685f689b251af 23-Oct-2009 Douglas Gregor <dgregor@apple.com> Eliminate QualifiedDeclRefExpr, which captured the notion of a
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,

namespace N { int i; }
int j = N::i;

Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.

Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bb378cbf04e343fb15ae3611a153dde60671b514 18-Oct-2009 Anders Carlsson <andersca@mac.com> Use CK_BitCast for member function pointer casts. Fixes PR5138.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
430656e1c392dcd9f17fe91a495421d69fca1bc8 14-Oct-2009 Chris Lattner <sabre@nondot.org> fix test/CodeGen/statements.c on 32-bit hosts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3c0ef8cc0dc246bd3083e8cdd63005e8873d36d2 13-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> Simplify pointer creation with the new Type::getInt*Ptr methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3ae9f48ae0d07a5aa352bf03c944f557a5ac4c95 13-Oct-2009 Chris Lattner <sabre@nondot.org> Teach sema and codegen about the difference between address of labels,
which is a common idiom to improve PIC'ness of code using the addr of
label extension. This implementation is a gross hack, but the only other
alternative would be to teach evalutate about this horrid combination.
While GCC allows things like "&&foo - &&bar + 1", people don't use this
in practice. This implements PR5131.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
dbd920c7758e6dfb678a8f503fb14ba97c26f23a 12-Oct-2009 Anders Carlsson <andersca@mac.com> Move the vtable builder to CGVtable.cpp, general cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
719aa44de4067c3910d02ab6a0fd0977d9f03261 03-Oct-2009 Anders Carlsson <andersca@mac.com> Pass the canonical method decl to GetVtableIndex. Fixes PR5120.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83272 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2c51f092e4d75550f51b4dd6f831aa5e5e6ae928 03-Oct-2009 Anders Carlsson <andersca@mac.com> Handle base-to-derived casts of member function pointers in CGExprConstant.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f57b4e44d03266f2ec1b427645555ed8952bc830 03-Oct-2009 Anders Carlsson <andersca@mac.com> Handle members to function pointers in CGExprConstant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2df96e7019853d80ea599453925bd324cd110a8f 02-Oct-2009 Anders Carlsson <andersca@mac.com> Don't update the struct alignment when adding fields to a packed struct. Fixes PR5118.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
31f2f9ced8ed2dd17ac43b6addc84eb08a05442e 02-Oct-2009 Anders Carlsson <andersca@mac.com> When building constant structs, check if the resulting LLVM struct will be bigger than the record layout size and use a packed struct if that's the case. Fixes PR5108.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
e9d34dc7afe06c9adaacad7a678a0cbbf749ea75 29-Sep-2009 Anders Carlsson <andersca@mac.com> Improve support for member function pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0d36dd28bb40b08a93d7f64196794882eee08ee8 19-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Make clang stop relying on ConstantStruct::get's default value for isPacked
which will be going away (ie. it's becoming a required parameter) later today.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
555b4bb2749aea2ec8e2adc351a71ec1cb9bdc33 11-Sep-2009 Anders Carlsson <andersca@mac.com> GlobalDecl doesn't have an explicit constructor anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d15d8c6395bbdc9b344ba6c6edf152502c2abfde 26-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Make address-space qualification work correctly for compound literals.
Issue reported on cfe-dev.

Also fixed the code to use isConstant to determine whether to generate a
constant global, to be consistent with CodeGenModule. This probably
needs to be refactored to deal with C++, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
ad3e7118c40711faf5f51f08d599dbd525d3408a 24-Aug-2009 Anders Carlsson <andersca@mac.com> More member pointer work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
70d488e6d0d3127aa53bee57ab9e746943ed47c3 23-Aug-2009 Anders Carlsson <andersca@mac.com> Whoops, comment this out for now. I'll fix it shortly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
fc3eaa47fa2ef70ab21131005c328adda3020737 23-Aug-2009 Anders Carlsson <andersca@mac.com> More work towards zero-initializing structs that contain member pointers in constant expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d1a9bac24466831e089c8f330ec9264fb3ace367 23-Aug-2009 Anders Carlsson <andersca@mac.com> Handle CK_NullToMemberPointer casts in the constant expr emitter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79790 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0086ccb1985f392ac688a19b35b300610db102e8 23-Aug-2009 Anders Carlsson <andersca@mac.com> Change the constant expression emitter to look at the cast kind for to-union casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0032b2781b4deb131f8c9b7968f2030bf2489cdd 13-Aug-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
237957c45774713f81fbd5394b3db4317fef0938 09-Aug-2009 Anders Carlsson <andersca@mac.com> Improve handling of member pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a10f7eabea651c5ba71569e69143dd77008f2a56 06-Aug-2009 Daniel Dunbar <daniel@zuster.org> Fix clang breakage, CGF can be null in this context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
47a434ff3d49e7906eda88e8e8242e4297725b32 06-Aug-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
b0d0ea042116c1f451d3db8ceff9f1dd92bc36d2 02-Aug-2009 Anders Carlsson <andersca@mac.com> use CodeGenModule::EmitNullConstant in a couple of places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c0879bbbe06f1983f1291669dcc1d451767c601c 02-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Fix a minor issue with unions in the new struct building code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
12905987c4ab9fb705f88f56b35298f730c8dbd5 31-Jul-2009 Anders Carlsson <andersca@mac.com> Remove the old struct builder code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
aaed50dfb52d358a407dbbdd1ca323f9328e957a 31-Jul-2009 Anders Carlsson <andersca@mac.com> Move code from EmitUnion directly into the function that handles cast-to-union.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f6c43965c41e042f0541bdd47b1511d585b2dcfd 31-Jul-2009 Anders Carlsson <andersca@mac.com> Use the struct builder for unions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c9c88b4159791c48e486ca94e3743b5979e2b7a6 31-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
96e0fc726c6fe7538522c60743705d5e696b40af 30-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
6217b80b7a1379b74cced1c076338262c3c980b3 29-Jul-2009 Ted Kremenek <kremenek@apple.com> Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()

And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3c4972def972f8ca44dcd0561779a12aaa6fec97 29-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4a28932dba03132dabbe70abdadcaae468dd7933 28-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7db6d838aad4083fe86d7bf703a75fe6e8a17856 28-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
08e252425ca2cbdc44ba65d9a657ed5398014e36 28-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bc0a2226c7fcd18b29b6846049e2cfcb872d3593 27-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
8dca3b3d09ff48b3ec528cd603f835f120c4d9ee 27-Jul-2009 Anders Carlsson <andersca@mac.com> Enable the new constant struct builder by default. The old code is still in place but will be removed shortly. The new struct builder works on big endian systems.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7a86d4b8a4fe34bb8a9e3bc94f839a4a657856b8 27-Jul-2009 Anders Carlsson <andersca@mac.com> More work on the constant struct builder, fix a couple of thinkos and add support for inserting part of a bitfield in the previous byte.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d24393bbc18fe8d30273e832fb9617604cb20493 27-Jul-2009 Anders Carlsson <andersca@mac.com> More work on bitfield support in the new constant struct builder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bea9c52992d98d7d837dfbdd226d02cbd8bab601 25-Jul-2009 Anders Carlsson <andersca@mac.com> More work on the constant struct builder. We can now convert the struct to a packed struct when necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4257bc6d5bd6ec0789287bc5ee7c2fea1f44c59e 25-Jul-2009 Anders Carlsson <andersca@mac.com> More work on the constant struct builder. We now try to layout all constant structs but throw away the result.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4a28d5deeba33722aa009eab488591fb9055cc7e 25-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5602719fd5394c1e00c8aac237eb006b6aa32e52 24-Jul-2009 Anders Carlsson <andersca@mac.com> Fix a release build warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4c98efdf06f94da20a640aa36f6a4f3284c26bff 24-Jul-2009 Anders Carlsson <andersca@mac.com> Check in a half finished new constant struct builder (Obviously not used yet).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
8330ceeebb3bfac31116b387b90ff2ce3cef85e4 23-Jul-2009 Anders Carlsson <andersca@mac.com> Move the LLVM field number for bit fields into the BitFieldInfo structure, since it's meaning is completely different than for non-bit fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
20d6d0474efc662924c4ca00a3511aac3782c4b0 23-Jul-2009 Anders Carlsson <andersca@mac.com> Use arrays as union padding. Also, since the resulting struct will always contain a single element and either a single i8 element or an array of i8s, there's no reason to use a packed struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76854 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
35366a67baa970c287c714c957cf78a4131cf60d 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5cad1f74469d4d8b4fc51fe53a7837778aeb6107 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a1cf15f4680e5cf39e72e28c5ea854fcba792e84 15-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change, and contextify a bunch of related stuff.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
fc494ff95e011400e0d76a3cb52be453c9d2c15b 14-Jul-2009 Owen Anderson <resistor@mac.com> Update for API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
69243825cb5c91ec7207256aa57ae327cfaf8cb2 13-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1c431b323d776362490bbf7cc796b74fedaf19f2 08-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c14f0d230257a8db58aee6329116a7e245e6bbd6 08-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
17945a0f64fe03ff6ec0c2146005a87636e3ac12 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> De-ASTContext-ify DeclContext.

Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4c4c527dc1877999dd2bdae74ae9ffbddedaf819 14-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4390: Make sure to handle anonymous unions correctly while building
static intializers for structs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1b63e4f732dbc73d90abf886b4d21f8e3a165f6d 14-Jun-2009 Chris Lattner <sabre@nondot.org> Sink the BuiltinInfo object from ASTContext into the
preprocessor and initialize it early in clang-cc. This
ensures that __has_builtin works in all modes, not just
when ASTContext is around.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
50c39ea4858265f3f5f42a0c624557ce2281936b 27-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix up constant expression handling to deal with the address
of a reference correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f5408fe484495ee4efbdd709c8a2c2fdbbbdb328 16-May-2009 Mike Stump <mrs@apple.com> Reflow some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71937 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
b4880bab7fc1b61267cfd9a0ad52188e7a828cb3 12-May-2009 Chris Lattner <sabre@nondot.org> push GlobalDecl through enough of the CodeGenModule interfaces
to allow us to support generation of deferred ctors/dtors.
It looks like codegen isn't emitting a call to the dtor in
member-functions.cpp:test2, but when it does, its body should
get emitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
9408c45009b417e758749b3d95cdfb87dcb68ea9 09-May-2009 Duncan Sands <baldrick@free.fr> Correct for renaming PaddedSize -> AllocSize in
LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
b03d9afa3f0522ca02139c9b55d1145369e32a0f 08-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix crash with constant initialization of bit-fields in unions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
944af7156db03d4ad15973dad259ab51d405e609 30-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4108: be a bit looser with the casts that we accept in
constant initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0f59312e7b625fa5821a63db65377d4b3b667e99 13-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Minor work related to removing the assumption that value initialization
implies an all-zero bit pattern.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1e5dc6e12ccda4e783c67fa9ae11be419d7b0573 11-Apr-2009 Anders Carlsson <andersca@mac.com> Add support for generating reference initialization code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
12e330c46ab3a4a12dbbd4ad7e96ffdd399f5518 10-Apr-2009 Anders Carlsson <andersca@mac.com> Rename variables to avoid conflict.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68764 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
6ab3524f72a6e64aa04973fa9433b5559abb3525 09-Apr-2009 Douglas Gregor <dgregor@apple.com> Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
e9352cc9818ba59e7cf88500ef048991c90f3821 08-Apr-2009 Anders Carlsson <andersca@mac.com> Add a destination type argument to EmitConstantExpr. This will be used for when the destination has a reference type. (No functionality change yet)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
8d4141f83d9de379547cf05bd75d4c6cf894b189 01-Apr-2009 Steve Naroff <snaroff@apple.com> More "prep" work for handling UTF16 CFString.

Patch by Jean-Daniel Dupas. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
33fdb738a6c125f4c788733897021b7c1a062b0c 31-Mar-2009 Steve Naroff <snaroff@apple.com> Some "prep" work for handling ObjC @-string constants that contain UTF-8. No functionality change.

Changed GenerateConstantString() to take an ObjCStringLiteral (instead of a std::string). While this isn't strictly necessary, it seems cleaner and allows us to cache to "containsNonAscii" if necessary (to avoid checking in both Sema and CodeGen).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
069880ef6a2ecfdbc98a4980de53d3902499e83b 03-Mar-2009 Anders Carlsson <andersca@mac.com> Return 0 if the ConstExprEmitter can't handle an expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4de9fce48e42cc7ec1345c0fd21b3dbc5b9114c8 01-Mar-2009 Anders Carlsson <andersca@mac.com> Do some blocks cleanup and simplification. Fix a crash, and add a test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65746 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
8a2b4b1c5b960710db95e9b296d9a600aee37c00 26-Feb-2009 Mike Stump <mrs@apple.com> CodeGen support for copied BlockDeclRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
eaf2bb89eb2aad3b80673de30febe52df43c10ec 24-Feb-2009 Chris Lattner <sabre@nondot.org> first wave of fixes for @encode sema support. This is part of PR3648.

The big difference here is that (like string literal) @encode has
array type, not pointer type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d01b669f26703663da3515638e254fa7a987e860 24-Feb-2009 Daniel Dunbar <daniel@zuster.org> Fix IRgen of constant expressions referring to external/static
variables.
- PR3657.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
ddd2b6e1e7406ab45f71398fb78b86c36acd789b 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Eliminate a bunch of code which should be dead.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
b83d287bc7f47d36fb0751a481e2ef9308b37252 19-Feb-2009 Mike Stump <mrs@apple.com> Add enough checking to ensure that non-constant block literals don't
appear to be constant. I'll probably redo this and throw it all away
later once we have codegen for BlockDeclRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
e20de512d88cf42a26ef994687d87fc6f5826625 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Remove IRgen constant emission assumption that LValue APValue results
only occur for pointer types; they are also possible for integer types
now.
- No intended functionality change, IntExprEvaluate doesn't return
LValue results yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bd65cac8de63d108a681035782a71d42954b03ab 19-Feb-2009 Mike Stump <mrs@apple.com> More codegen for blocks. The type of block literals should be better.
The size calculation is improved.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d60f2fbf69df08e952377b498c036f269395024d 17-Feb-2009 Daniel Dunbar <daniel@zuster.org> Change EmitConstantExpr to allow failure.

IRgen no longer relies on isConstantInitializer, instead we just try
to emit the constant. If that fails then in C we emit an error
unsupported (this occurs when Sema accepted something that it doesn't
know how to fold, and IRgen doesn't know how to emit) and in C++ we
emit a guarded initializer.

This ends up handling a few more cases, because IRgen was actually
able to emit some of the constants Sema accepts but can't Evaluate().
For example, PR3398.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
67a6448a8d52ae46d1cba4e474f9f6b3968d2ff9 14-Feb-2009 Mike Stump <mrs@apple.com> Generate the helper function for blocks. Now basic codegen is
starting to work for blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3c385e5f8d9008fff18597ca302be19fa86e51f6 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Add hook to add attributes to function declarations that we know
about, whether they are builtins or not. Use this to add the
appropriate "format" attribute to NSLog, NSLogv, asprintf, and
vasprintf, and to translate builtin attributes (from Builtins.def)
into actual attributes on the function declaration.

Use the "printf" format attribute on function declarations to
determine whether we should do format string checking, rather than
looking at an ad hoc list of builtins and "known" function names.

Be a bit more careful about when we consider a function a "builtin" in
C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d5cab5435371b8cc74a9e05ebd40b5995ebad149 12-Feb-2009 Anders Carlsson <andersca@mac.com> Add a very basic implemenation of global blocks. This needs to be cleaned up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
71d817451626fe7ac6b080955ff87624b76bd058 11-Feb-2009 Douglas Gregor <dgregor@apple.com> Silence a warning about an unused variable in -Asserts builds

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7f5221b023bca69a3f5fdbe03934edb74a25fa18 01-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3447: use padded sizes for computations on struct/union
constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7d801eae4db97c46e47c40d431d34225ce6f6143 30-Jan-2009 Anders Carlsson <andersca@mac.com> Implement constant generation of ImplicitValueInitExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3498bdb9e9cb300de74c7b51c92608e2902b2348 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Introduce a new expression node, ImplicitValueInitExpr, that
represents an implicit value-initialization of a subobject of a
particular type. This replaces the (ab)use of CXXZeroValueInitExpr
within initializer lists for the "holes" that occur due to the use of
C99 designated initializers.

The new test case is currently XFAIL'd, because CodeGen's
ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be
taught to value-initialize when it sees ImplicitValueInitExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0bb76897bedb8b747efc6523efb432fc24966118 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Clean up designated initialization of unions, so that CodeGen doesn't
have to try to guess which member is being initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
34e7946831a63f96d3ba3478c74ca8e25ee52d7e 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Improvements to code-generation and semantic analysis of designated
initializers.

- We now initialize unions properly when a member other than the
first is named by a designated initializer.
- We now provide proper semantic analysis and code generation for
GNU array-range designators *except* that side effects will occur
more than once. We warn about this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a5fd07bbc5e4bae542c06643da3fbfe4967a9379 28-Jan-2009 Daniel Dunbar <daniel@zuster.org> Implement basic _Complex integer constant folding.
- Merged into single ComplexEvaluator, these share too much logic to
be worth splitting for float/int (IMHO). Will split on request.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4c67834407ca6ab344dcf44fc599ad4938cfa96d 28-Jan-2009 Douglas Gregor <dgregor@apple.com> Code generation support for C99 designated initializers.

The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.

Known limitations:
- Designating a member of a union that isn't the first member may
result in bogus initialization (we warn about this)
- GNU array-range designators are not supported (we warn about this)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1ef0965bbd46a2915746ffe8067d411b18117415 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Get rid of some code that should be unnecessary.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3941b18b8e441c8c466efecd557de60b9a32d10b 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Make the constant folder aware of
__builtin___CFStringMakeConstantString. (We get into trouble in
GenerateStaticBlockVarDecl if the constant folder isn't accurate.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f01158941ba4560c63150032073bb231ce38999e 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Fix the address of a label to be properly considered and emitted as a
constant.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
9b6f4dec090faab0a78de669c037b563ac076e0b 24-Jan-2009 Chris Lattner <sabre@nondot.org> remove dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3d309f9d62a6f9f634b869937139d533ccd7265b 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Add support for vectors to APValue. Vector constant evaluator and tests coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
81e51e2c5bf1e4edc3b70040e2083fa83d314e40 17-Jan-2009 Nuno Lopes <nunoplopes@sapo.pt> add support for usage of cast to union thing with static vars

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
491c7b77cd8ec8570f646d43b937a5aec688bcbf 12-Jan-2009 Daniel Dunbar <daniel@zuster.org> (LLVM up) Match TargetData API change in LLVM TOT.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1a49af9681c350fef58e677f85ccb9a77e8e9d0a 06-Jan-2009 Douglas Gregor <dgregor@apple.com> Add QualifiedDeclRefExpr, which retains additional source-location
information for declarations that were referenced via a qualified-id,
e.g., N::C::value. We keep track of the location of the start of the
nested-name-specifier. Note that the difference between
QualifiedDeclRefExpr and DeclRefExpr does have an effect on the
semantics of function calls in two ways:
1) The use of a qualified-id instead of an unqualified-id suppresses
argument-dependent lookup
2) If the name refers to a virtual function, the qualified-id
version will call the function determined statically while the
unqualified-id version will call the function determined dynamically
(by looking up the appropriate function in the vtable).

Neither of these features is implemented yet, but we do print out
qualified names for QualifiedDeclRefExprs as part of the AST printing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
86f194083504938df72135b5b66bf0c5cafd9498 21-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for member references (E1.E2, E1->E2) with C++ semantics,
which can refer to static data members, enumerators, and member
functions as well as to non-static data members.

Implement correct lvalue computation for member references in C++.
Compute the result type of non-static data members of reference type properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
35345640442594acbc29445fbde4874a6e4c860a 12-Dec-2008 Chris Lattner <sabre@nondot.org> add codegen support for __func__ and friends, producing the same
output that GCC does. rdar://6440297


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
44b4321feab46299d3f5cfd404680884752a0fcf 11-Dec-2008 Douglas Gregor <dgregor@apple.com> Unifies the name-lookup mechanisms used in various parts of the AST
and separates lexical name lookup from qualified name lookup. In
particular:
* Make DeclContext the central data structure for storing and
looking up declarations within existing declarations, e.g., members
of structs/unions/classes, enumerators in C++0x enums, members of
C++ namespaces, and (later) members of Objective-C
interfaces/implementations. DeclContext uses a lazily-constructed
data structure optimized for fast lookup (array for small contexts,
hash table for larger contexts).

* Implement C++ qualified name lookup in terms of lookup into
DeclContext.

* Implement C++ unqualified name lookup in terms of
qualified+unqualified name lookup (since unqualified lookup is not
purely lexical in C++!)

* Limit the use of the chains of declarations stored in
IdentifierInfo to those names declared lexically.

* Eliminate CXXFieldDecl, collapsing its behavior into
FieldDecl. (FieldDecl is now a ScopedDecl).

* Make RecordDecl into a DeclContext and eliminates its
Members/NumMembers fields (since one can just iterate through the
DeclContext to get the fields).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
4b3f9c06d548d3de576441a91ef986c6840bd983 01-Dec-2008 Anders Carlsson <andersca@mac.com> Change more code over to using the new Expr::Evaluate

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
704e4907ee0116e53f270d778c955da9f01fc2d8 25-Nov-2008 Anders Carlsson <andersca@mac.com> Remove the #ifdeffed out code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bcf6225ad69ea388e287f952981fd076636991b2 22-Nov-2008 Anders Carlsson <andersca@mac.com> Use tryEvaluate for constant exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7b30b1c866deb37fabe2b25684b7d238258d46ad 17-Nov-2008 Eli Friedman <eli.friedman@gmail.com> A few corrections to the expr constant work. Not enabled at the
moment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
aa432560efb1ff10aec504a68fe909cd9ae7c1a2 17-Nov-2008 Anders Carlsson <andersca@mac.com> More expr constant work. (Off by default).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
6ee7aa154e8bbb21a21254293410b944f78b0bfe 16-Nov-2008 Chris Lattner <sabre@nondot.org> rename Expr::tryEvaluate to Expr::Evaluate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5ea7d07ea7d9f2b679c85df7cc45fcc6e157e396 16-Nov-2008 Anders Carlsson <andersca@mac.com> More constant expr work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59405 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
5a9a457ecf66343ae8b64baa7909007837b2a2cd 15-Nov-2008 Anders Carlsson <andersca@mac.com> Check in code that uses tryEvaluate for emitting constant exprs (not used yet).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d114ade7f12e388c685e293ae94356c6b0b221f7 15-Nov-2008 Anders Carlsson <andersca@mac.com> Use IgnoreParenCasts. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0518999d3adcc289997bd974dce90cc97f5c1c44 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
be20bb558cae5352898e6a913e29d24d20134841 27-Oct-2008 Chris Lattner <sabre@nondot.org> make codegen reject initializes with designators, like this:

t.c:1:13: error: cannot codegen this designators yet
int a[10] = {2, 4, [8]=9, 10};
^~~~~~~~~~~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
8e9bebdea69c590dedfbf27374114cb76fe12fbd 21-Oct-2008 Douglas Gregor <dgregor@apple.com> Preliminary support for function overloading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
3304e55f613ce34d9a14c3aaf06f5949408b3092 12-Oct-2008 Chris Lattner <sabre@nondot.org> silence release-assert warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
506ff88f44562df267b6a06608ab841b76df2a2b 06-Oct-2008 Chris Lattner <sabre@nondot.org> Make sema and codegen allow __builtin___CFStringMakeConstantString as a valid
constant lvalue. Implement this in codegen by moving the code out of CGBuiltin
into EmitConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
f6b24ea67b5898295e2fc645327837037462a0fd 06-Oct-2008 Chris Lattner <sabre@nondot.org> instead of making codegen try to know about all of the builtins to generate
constants for them, just use the constant evaluator to do the job. This
also fixes crashes on 'unknown constant builtins'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
2ea2b5e2b044739f4f5840bc1271abfa15a3101d 25-Aug-2008 Anders Carlsson <andersca@mac.com> Handle emitting __builtin_huge_valf as a constant expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7267f7832e5f0c7f951765e201c5a2650eb1637b 23-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add CodeGen support for CXXZeroInitValueExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
0835a3cdeefe714b4959d31127ea155e56393125 19-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add ExplicitCastExpr to replace the current CastExpr, and have ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr):

Expr
-> CastExpr
-> ExplicitCastExpr
-> ImplicitCastExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
54d19091a809d30a5e6e352fda53377d69ebda66 16-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add CodeGen support for AddrLabelExpr in initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
488e993a135ce700b982bf099c3d6b856301d642 16-Aug-2008 Daniel Dunbar <daniel@zuster.org> Change WarnUnsupported to ErrorUnsupported (in name and in practice).
- We are beyond the point where this shows up often and when it does
generating miscompiled files is bad.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
6143293fa4366ee95d7e47e61bd030a34bf68b55 14-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add GetAddrOfConstantCString method
- Returns addr of constant for argument + '\0'.
- I couldn't think of a better name.
- Move appropriate users of GetAddrOfConstantString to this.

Rename getStringForStringLiteral to GetStringForStringLiteral.

Add GetAddrOfConstantStringFromLiteral
- This combines GetAddrOfConstantString and
GetStringForStringLiteral. This method can be, but is not yet, more
efficient.

Change GetAddrOfConstantString to not add terminating '\0'
- <rdar://problem/6140956>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
af2f62ce32e462f256855cd24b06dec4755d2827 13-Aug-2008 Daniel Dunbar <daniel@zuster.org> Change ObjCRuntime GenerateProtocol[Ref] methods to take
ObjCProtocolDecl directly.

Implement CodeGen support for forward protocol decls (no-ops are so
nice to implement).

Also moved CGObjCRuntime.h out of CodeGenModule.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bbce49b9e5c6d7f05926b89f8e6fd235ae01c250 12-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add ObjC constant string support for NeXT.

Changed CGObjCRuntime::GenerateConstantString interface to take
std::string instead of char* and size.

Change ObjC functions which call on GenerateConstantString to bitcast
result to appropriate type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
208ff5e8a073de2a5d15cbe03cab8a4c0d935e28 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> Change CodeGenModule to only create ObjC runtime for ObjC files
- Changed CodeGenModule::getObjCRuntime to return reference.
- Added CodeGenModule::hasObjCRuntime predicate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
de7fb8413b13651fd85b7125d08b3c9ac2816d9d 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Remove internal uses of AST.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1e04976fc2611d8cc06986a81deed4c42183b870 10-Aug-2008 Daniel Dunbar <daniel@zuster.org> Back out r54608 (inline string literals were getting an extra '\0')
temporarily, I assumed GetAddrForConstantString literal was being
used consistently but it doesn't look like it is.

Factored out a CodeGenModule::getStringForStringLiteral which handles
extracting a std::string for the bytes of a StringLiteral, padded to
match the type.

Update EmitLValue to use getStringForStringLiteral, this was
previously not padding strings correctly. Good thing we only emit
strings in 4 different places!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
9ca8bb0996bbb8b9dbf69c51cb3d1523559e47e3 10-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix crash during initialization of a bitfield which followed a zero
length element.

Fix some 80-col violations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c63a1f276f7b324fd9a4be82098b1c8f7bf30733 04-Aug-2008 Chris Lattner <sabre@nondot.org> Finally fix PR2189. This makes a fairly invasive but important change to
move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).

Fixing this greatly simplifies getArrayDecayedType, which is a good sign.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bd012ff1fa088181646a784f385b28867372d434 30-Jul-2008 Daniel Dunbar <daniel@zuster.org> Rework codegen emission of globals
- No (intended) functionality change.

- Primary purpose is to clearly separate (lazy) construction of
globals that are a forward declaration or tentative definition from
those that are the final definition.

- Lazy construction is now encapsulated in
GetAddrOf{Function,GlobalVar} while final definitions are
constructed in EmitGlobal{Function,Var}Definition.

- External interface for dealing with globals is now limited to
EmitGlobal and GetAddrOf{Function,GlobalVar}.

- Also updated helper functions dealing with statics, annotations,
and ctors to be private.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
d394cc6f0fca198ec8def0f1cfaf16b5df0d52fa 27-Jul-2008 Chris Lattner <sabre@nondot.org> Fix a bug in my previous patch, CGF is not valid for constants outside a function


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
9619662a1d42e2008b865d3459c0677e149dad1b 27-Jul-2008 Chris Lattner <sabre@nondot.org> remove uses of QualType::getCanonicalType() from codegen for PR2189


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
1f3846e3013a3b6679aeaa2e4c61de37a5c320ee 17-Jul-2008 Daniel Dunbar <daniel@zuster.org> Fix for codegen crash on multibit bool bitfield initialization
<rdar://problem/6078606>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
13fd7e5111032f54b538dd66d035b0ccc1f82467 21-Jun-2008 Chris Lattner <sabre@nondot.org> "this patch adds code generation hooks for Objective-C constant strings. It also modifies Sema so that Objective-C constant strings are treated as untyped objects if the interface for the constant string class can not be found. This is consistent with Apple GCC. I thought it was consistent with GNU GCC, since this was causing failures when trying to compile GNUstep with (GNU) GCC, but it appears that this is not the case when attempting to produce a simple test case to demonstrate it. Possibly there is a way of making the error go away, but I haven't found out what it is yet."

Patch by David Chisnall!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c53296eb6d97f37fc1326f3ab38c3c811390b838 07-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Fix crash with conversion to an address-space-qualified pointer. Bug
reported on cfe-dev by Cédric Venet.

Note that I seriously doubt that this perticular construct is useful,
though: it's a pointer in an alternate address space pointing into
unqualified address space.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
c55f98dbdffb73894a8dbe7b0ce176604fe42127 06-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Reorganize this loop a bit so it doesn't crash for empty unions. Fixes
PR2419.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
77e1dfcffe9ed0078b015418182784b56532998c 06-Jun-2008 Nuno Lopes <nunoplopes@sapo.pt> implement constant expr. sub ptr ptr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
7dfa639e9274b9f40c8f207e35c0fcbfe75d04f8 01-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Make sure _Bool globals have the correct type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a04a1538ee5e286e94e3374caf51ba1094d289b0 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix and enable generating general union initializers. Essentially, what
this does is reconstruct the type for structs and arrays if the type
wouldn't be compatible otherwise.

The assertion about packing in the struct type reconstruction code
sucks, but I don't see any obvious way to fix it. Maybe we need a general
utility method to take a list of types and alignments and try to construct an
unpacked type if possible?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
cfb313bd56fb935c54544489d71d77364fd312db 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix constant vector init for initializer lists with an incomplete list
of elements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
a823400df727968fda4b2df23abab0d8ecff7a75 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Some additions to constant initializer generation code. Adds
bit-field initialization; ugly code, X86-only, but it works, at least
for basic stuff. Separates/adds union initialization; currently disabled,
though, because the struct/array code needs modifications to support
elements of the wrong type.

Fixes PR2381 and PR2309 with the bit-field initialization. And NetHack
compiles and appears to work with a few tweaks (to work around the lack
of transparent_union support, and clang being a bit strict about
conflicting declarations).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
b896596a94315485e1d5cfabfbc3f82fd7f96393 29-May-2008 Eli Friedman <eli.friedman@gmail.com> More complete/correct implementation of the comparison operators for
constant expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bc5ed6ef52d43b5a3c924421aac3c1f0f829dcc8 29-May-2008 Eli Friedman <eli.friedman@gmail.com> Add codegen support for a few more kinds of initializer constant
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
017cbdfd5417d4d31ae6406421276f90269f75e2 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Restructure constant structure init codegen so that it's possible to
implement bitfield codegen (although I don't envy the person who
implements it). This also prevents a crash on code like that from PR2309
(it's still broken, but it fails more gracefully).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
ef648c76745ee5e4105eec22dbc97fac18145bd6 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Remove code that shouldn't have any effect anymore.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
59138ba7ce960888433546639deb45e2e03f8857 20-Apr-2008 Chris Lattner <sabre@nondot.org> use simplified ConstantFP:get method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
248a753f6b670692523c99afaeb8fe98f7ae3ca7 16-Apr-2008 Steve Naroff <snaroff@apple.com> Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().

This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
04421087832a031c90bd58f128c7c0e741db8dd2 08-Apr-2008 Chris Lattner <sabre@nondot.org> Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp
bda0b626e74513950405c27525af87e214e605e2 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGExprConstant.cpp