History log of /external/clang/lib/CodeGen/CodeGenFunction.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b0e603c63813c8378e35a75408ab4cefe71e93e2 26-Jul-2013 Adrian Prantl <aprantl@apple.com> Debug Info / EmitCallArgs: arguments may modify the debug location.
Restore it after each argument is emitted. This fixes the scope info for
inlined subroutines inside of function argument expressions. (E.g.,
anything STL).

rdar://problem/12592135

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6e007f9fa0b9ebe5898025010c5ebc7d82decfa7 19-Jul-2013 Timur Iskhodzhanov <timurrrr@google.com> Simplify the CodeGenFunction::Build*Virtual*Call family of functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6b9240e058bf3451685df73fc8ce181b3046e92b 05-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl& for function arguments instead of SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3b50e8d78c34fc57e25781015a2cb0536ca54f89 30-Jun-2013 Stephen Lin <stephenwlin@gmail.com> Restore r184205 and associated commits (after commit of r185290)

This allows clang to use the backend parameter attribute 'returned' when generating 'this'-returning constructors and destructors in ARM and MSVC C++ ABIs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1d7bb6c8b5b8f98fe79607718441f6543de598f1 28-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3258abc2bad74e8bb1799d124bc4113c7234fa42 20-Jun-2013 Stephen Lin <stephenwlin@gmail.com> Revert r184205 and associated patches while investigating issue with broken buildbot (possible interaction with LTO)

<rdar://problem/14209661>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
43a75fcbe4b592d7bea1fe262117114bcebc003c 19-Jun-2013 Reid Kleckner <reid@kleckner.net> [CodeGen] Move EHScopeStack into its own header

CGCleanup.h isn't meant to be included by all of CodeGen according to
John.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d4c0cd07641681de6ed12164aa7a4495ab4b18e5 18-Jun-2013 Stephen Lin <stephenwlin@gmail.com> CodeGen: Have 'this'-returning constructors and destructors to take advantage of the new backend 'returned' attribute.

The backend will now use the generic 'returned' attribute to form tail calls where possible, as well as avoid save-restores of 'this' in some cases (specifically the cases that matter for the ARM C++ ABI).

This patch also reverts a prior front-end only partial implementation of these optimizations, since it's no longer required.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d4ec562b3aaf50ea9015f82c96ebfd05a35fc7ef 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Simplify: we don't need any special-case lifetime extension when initializing
declarations of reference type; they're handled by the general case handling of
MaterializeTemporaryExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
8a07cd3f59a0ede54906bdc8ed21724815db27ad 12-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Reapply r183721, reverted in r183776, with a fix for a bug in the former (we
were lacking ExprWithCleanups nodes in some cases where the new approach to
lifetime extension needed them).

Original commit message:

Rework IR emission for lifetime-extended temporaries. Instead of trying to walk
into the expression and dig out a single lifetime-extended entity and manually
pull its cleanup outside the expression, instead keep a list of the cleanups
which we'll need to emit when we get to the end of the full-expression. Also
emit those cleanups early, as EH-only cleanups, to cover the case that the
full-expression does not terminate normally. This allows IR generation to
properly model temporary lifetime when multiple temporaries are extended by the
same declaration.

We have a pre-existing bug where an exception thrown from a temporary's
destructor does not clean up lifetime-extended temporaries created in the same
expression and extended to automatic storage duration; that is not fixed by
this patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0934e18b620ecaa6c7ec18ba5c4286b6122d6fb8 12-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Add support for complex compound assignments where the LHS is a scalar.

Fixes <rdar://problem/11224126> and PR12790.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a57be5617a0735a654d4c8145be1fd752f776772 11-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Revert r183721. It caused cleanups to be delayed too long in some cases.
Testcase to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
85af7cecadbf5d4b905d6b3b4b1b6fa684183aff 11-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Rework IR emission for lifetime-extended temporaries. Instead of trying to walk
into the expression and dig out a single lifetime-extended entity and manually
pull its cleanup outside the expression, instead keep a list of the cleanups
which we'll need to emit when we get to the end of the full-expression. Also
emit those cleanups early, as EH-only cleanups, to cover the case that the
full-expression does not terminate normally. This allows IR generation to
properly model temporary lifetime when multiple temporaries are extended by the
same declaration.

We have a pre-existing bug where an exception thrown from a temporary's
destructor does not clean up lifetime-extended temporaries created in the same
expression and extended to automatic storage duration; that is not fixed by
this patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2ac2fa7726eb2f6fe445e098489e92931c31f7ca 11-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Make sure we don't emit invalid IR for StmtExprs with complex cleanups.

Fixes <rdar://problem/14074868>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6fe91e448f948b78a36dd7f978125e0a882c623f 09-Jun-2013 Reid Kleckner <reid@kleckner.net> [CodeGen] Move EHScopeStack to CGCleanup.h from CodeGenFunction.h

No functionality change. CGCleanup.cpp provides the implementation for
EHScopeStack, so it seems more consistent to place the class definition
in CGCleanup.h.

This should also help solve a header ordering problem that I have.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b0f533e716ae5a21ca5682ea235a68082fd5ed28 29-May-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Implement MSVC virtual base adjustment

While we can't yet emit vbtables, this allows us to find virtual bases
of objects constructed in other TUs.

This make iostream hello world work, since basic_ostream virtually
inherits from basic_ios.

Differential Revision: http://llvm-reviews.chandlerc.com/D795

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1c3db769249a633108dc320da87c48a432e2bcc1 16-May-2013 Adrian Prantl <aprantl@apple.com> Cleanup: Use a member variable to store the SourceLocation for EH code.
rdar://problem/13888152

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7247c88d1e41514a41085f83ebf03dd5220e054a 15-May-2013 David Blaikie <dblaikie@gmail.com> Use only explicit bool conversion operator

The most common (non-buggy) case are where such objects are used as
return expressions in bool-returning functions or as boolean function
arguments. In those cases I've used (& added if necessary) a named
function to provide the equivalent (or sometimes negative, depending on
convenient wording) test.

DiagnosticBuilder kept its implicit conversion operator owing to the
prevalent use of it in return statements.

One bug was found in ExprConstant.cpp involving a comparison of two
PointerUnions (PointerUnion did not previously have an operator==, so
instead both operands were converted to bool & then compared). A test
is included in test/SemaCXX/constant-expression-cxx1y.cpp for the fix
(adding operator== to PointerUnion in LLVM).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
524387ae3dfc0c4cf2b095f83f9e47aa549b7e55 09-May-2013 Ben Langmuir <ben.langmuir@intel.com> CodeGen for CapturedStmts

EmitCapturedStmt creates a captured struct containing all of the captured
variables, and then emits a call to the outlined function. This is similar in
principle to EmitBlockLiteral.

GenerateCapturedFunction actually produces the outlined function. It is based
on GenerateBlockFunction, but is much simpler. The function type is determined
by the parameters that are in the CapturedDecl.

Some changes have been added to this patch that were reviewed as part of the
serialization patch and moving the parameters to the captured decl.

Differential Revision: http://llvm-reviews.chandlerc.com/D640


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4c71b8cded575b0cfc133c5da4502ca613982094 07-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't crash in IRGen if a conditional with 'throw' in one of its branches is
used as a branch condition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ff920eec4d449bee560d8d99636ad0eb50cd9d8d 04-May-2013 Tim Northover <Tim.Northover@arm.com> AArch64: teach Clang about __clear_cache intrinsic

libgcc provides a __clear_cache intrinsic on AArch64, much like it
does on 32-bit ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d072e59eb6b5e32f93be25f08f212b0ec21d6c5d 03-May-2013 Adrian Prantl <aprantl@apple.com> Reapply r180982 with repaired logic and an additional testcase.

Un-break the gdb buildbot.
- Use the debug location of the return expression for the cleanup code
if the return expression is trivially evaluatable, regardless of the
number of stop points in the function.
- Ensure that any EH code in the cleanup still gets the line number of
the closing } of the lexical scope.
- Added a testcase with EH in the cleanup.

rdar://problem/13442648

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f5ebf9bf1df10ac15ba32a4b24dfe171b7848c58 03-May-2013 John McCall <rjmccall@apple.com> Correctly emit certain implicit references to 'self' even within
a lambda.

Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation
functions. Fix that by generally improving getNonClosureContext
to look through lambdas and captured statements but only report
code contexts, which is generally what's wanted. Audit uses of
CurFuncDecl and getNonClosureAncestor for correctness.

Bug #2 is that lambdas weren't specially mapping 'self' when inside
an ObjC method. Fix that by removing the requirement for that
and using the normal EmitDeclRefLValue path in LoadObjCSelf.

rdar://13800041

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bb09f7b1d9312471b701f2683a9d955b4e954630 03-May-2013 Adrian Prantl <aprantl@apple.com> Revert "Attempt to un-break the gdb buildbot."

This reverts commit 180982.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
30c0d27b61e38ad6038eeb8650f0dac83056c75b 03-May-2013 Adrian Prantl <aprantl@apple.com> Attempt to un-break the gdb buildbot.
- Use the debug location of the return expression for the cleanup code
if the return expression is trivially evaluatable, regardless of the
number of stop points in the function.
- Ensure that any EH code in the cleanup still gets the line number of
the closing } of the lexical scope.
- Added a testcase with EH in the cleanup.

rdar://problem/13442648

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
fa6b079b1231366696f6a497c6a084c73a35c85d 02-May-2013 Adrian Prantl <aprantl@apple.com> Ensure that the line table for functions with cleanups is sequential.

If there is cleanup code, the cleanup code gets the debug location of
the closing '}'. The subsequent ret IR-instruction does not get a
debug location. The return _expression_ will get the debug location
of the return statement.

If the function contains only a single, simple return statement,
the cleanup code may become the first breakpoint in the function.
In this case we set the debug location for the cleanup code
to the location of the return statement.

rdar://problem/13442648

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180932 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c7b5f381ed41a238aa4c243f99170909f64a3414 26-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> ArrayRefize code. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
b80a16eadd0dacabfc1c32412e243ccb99dd664d 19-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement CodeGen for C++11 thread_local, following the Itanium ABI specification as discussed on cxx-abi-dev.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
64aa4b3ec7e62288e2e66c1935487ece995ca94b 17-Apr-2013 John McCall <rjmccall@apple.com> Standardize accesses to the TargetInfo in IR-gen.

Patch by Stephen Lin!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
051303ce09291dfbed537fa33b0d8a4d92c82b75 16-Apr-2013 Tareq A. Siraj <tareq.a.sriaj@intel.com> Implement CapturedStmt AST

CapturedStmt can be used to implement generic function outlining as described in
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html.

CapturedStmt is not exposed to the C api.

Serialization and template support are pending.

Author: Wei Pan <wei.pan@intel.com>

Differential Revision: http://llvm-reviews.chandlerc.com/D370


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b37a73d5c6a0c8bb1f6e363d3b53980e4fa0cead 04-Apr-2013 Manman Ren <mren@apple.com> Initial support for struct-path aware TBAA.

Added TBAABaseType and TBAAOffset in LValue. These two fields are initialized to
the actual type and 0, and are updated in EmitLValueForField.
Path-aware TBAA tags are enabled for EmitLoadOfScalar and EmitStoreOfScalar.
Added command line option -struct-path-tbaa.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7cc0a110bcf3fe9c4d1269ea2ae7e72aa7f37531 04-Apr-2013 Manman Ren <mren@apple.com> revert r178784 since it does not have a commit message

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ab4ffe242935ae0dd66fbe0dcc792c1ad38b00c1 04-Apr-2013 Manman Ren <mren@apple.com> Index: include/clang/Driver/CC1Options.td
===================================================================
--- include/clang/Driver/CC1Options.td (revision 178718)
+++ include/clang/Driver/CC1Options.td (working copy)
@@ -161,6 +161,8 @@
HelpText<"Use register sized accesses to bit-fields, when possible.">;
def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">,
HelpText<"Turn off Type Based Alias Analysis">;
+def struct_path_tbaa : Flag<["-"], "struct-path-tbaa">,
+ HelpText<"Turn on struct-path aware Type Based Alias Analysis">;
def masm_verbose : Flag<["-"], "masm-verbose">,
HelpText<"Generate verbose assembly output">;
def mcode_model : Separate<["-"], "mcode-model">,
Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td (revision 178718)
+++ include/clang/Driver/Options.td (working copy)
@@ -587,6 +587,7 @@
Flags<[CC1Option]>, HelpText<"Disable spell-checking">;
def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group<f_Group>;
def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group<f_Group>;
+def fstruct_path_tbaa : Flag<["-"], "fstruct-path-tbaa">, Group<f_Group>;
def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group<f_Group>;
def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group<f_Group>;
def fno_threadsafe_statics : Flag<["-"], "fno-threadsafe-statics">, Group<f_Group>,
Index: include/clang/Frontend/CodeGenOptions.def
===================================================================
--- include/clang/Frontend/CodeGenOptions.def (revision 178718)
+++ include/clang/Frontend/CodeGenOptions.def (working copy)
@@ -85,6 +85,7 @@
VALUE_CODEGENOPT(OptimizeSize, 2, 0) ///< If -Os (==1) or -Oz (==2) is specified.
CODEGENOPT(RelaxAll , 1, 0) ///< Relax all machine code instructions.
CODEGENOPT(RelaxedAliasing , 1, 0) ///< Set when -fno-strict-aliasing is enabled.
+CODEGENOPT(StructPathTBAA , 1, 0) ///< Whether or not to use struct-path TBAA.
CODEGENOPT(SaveTempLabels , 1, 0) ///< Save temporary labels.
CODEGENOPT(SanitizeAddressZeroBaseShadow , 1, 0) ///< Map shadow memory at zero
///< offset in AddressSanitizer.
Index: lib/CodeGen/CGExpr.cpp
===================================================================
--- lib/CodeGen/CGExpr.cpp (revision 178718)
+++ lib/CodeGen/CGExpr.cpp (working copy)
@@ -1044,7 +1044,8 @@
llvm::Value *CodeGenFunction::EmitLoadOfScalar(LValue lvalue) {
return EmitLoadOfScalar(lvalue.getAddress(), lvalue.isVolatile(),
lvalue.getAlignment().getQuantity(),
- lvalue.getType(), lvalue.getTBAAInfo());
+ lvalue.getType(), lvalue.getTBAAInfo(),
+ lvalue.getTBAABaseType(), lvalue.getTBAAOffset());
}

static bool hasBooleanRepresentation(QualType Ty) {
@@ -1106,7 +1107,9 @@

llvm::Value *CodeGenFunction::EmitLoadOfScalar(llvm::Value *Addr, bool Volatile,
unsigned Alignment, QualType Ty,
- llvm::MDNode *TBAAInfo) {
+ llvm::MDNode *TBAAInfo,
+ QualType TBAABaseType,
+ uint64_t TBAAOffset) {
// For better performance, handle vector loads differently.
if (Ty->isVectorType()) {
llvm::Value *V;
@@ -1158,8 +1161,11 @@
Load->setVolatile(true);
if (Alignment)
Load->setAlignment(Alignment);
- if (TBAAInfo)
- CGM.DecorateInstruction(Load, TBAAInfo);
+ if (TBAAInfo) {
+ llvm::MDNode *TBAAPath = CGM.getTBAAStructTagInfo(TBAABaseType, TBAAInfo,
+ TBAAOffset);
+ CGM.DecorateInstruction(Load, TBAAPath);
+ }

if ((SanOpts->Bool && hasBooleanRepresentation(Ty)) ||
(SanOpts->Enum && Ty->getAs<EnumType>())) {
@@ -1217,7 +1223,8 @@
bool Volatile, unsigned Alignment,
QualType Ty,
llvm::MDNode *TBAAInfo,
- bool isInit) {
+ bool isInit, QualType TBAABaseType,
+ uint64_t TBAAOffset) {

// Handle vectors differently to get better performance.
if (Ty->isVectorType()) {
@@ -1268,15 +1275,19 @@
llvm::StoreInst *Store = Builder.CreateStore(Value, Addr, Volatile);
if (Alignment)
Store->setAlignment(Alignment);
- if (TBAAInfo)
- CGM.DecorateInstruction(Store, TBAAInfo);
+ if (TBAAInfo) {
+ llvm::MDNode *TBAAPath = CGM.getTBAAStructTagInfo(TBAABaseType, TBAAInfo,
+ TBAAOffset);
+ CGM.DecorateInstruction(Store, TBAAPath);
+ }
}

void CodeGenFunction::EmitStoreOfScalar(llvm::Value *value, LValue lvalue,
bool isInit) {
EmitStoreOfScalar(value, lvalue.getAddress(), lvalue.isVolatile(),
lvalue.getAlignment().getQuantity(), lvalue.getType(),
- lvalue.getTBAAInfo(), isInit);
+ lvalue.getTBAAInfo(), isInit, lvalue.getTBAABaseType(),
+ lvalue.getTBAAOffset());
}

/// EmitLoadOfLValue - Given an expression that represents a value lvalue, this
@@ -2494,9 +2505,12 @@

llvm::Value *addr = base.getAddress();
unsigned cvr = base.getVRQualifiers();
+ bool TBAAPath = CGM.getCodeGenOpts().StructPathTBAA;
if (rec->isUnion()) {
// For unions, there is no pointer adjustment.
assert(!type->isReferenceType() && "union has reference member");
+ // TODO: handle path-aware TBAA for union.
+ TBAAPath = false;
} else {
// For structs, we GEP to the field that the record layout suggests.
unsigned idx = CGM.getTypes().getCGRecordLayout(rec).getLLVMFieldNo(field);
@@ -2508,6 +2522,8 @@
if (cvr & Qualifiers::Volatile) load->setVolatile(true);
load->setAlignment(alignment.getQuantity());

+ // Loading the reference will disable path-aware TBAA.
+ TBAAPath = false;
if (CGM.shouldUseTBAA()) {
llvm::MDNode *tbaa;
if (mayAlias)
@@ -2541,6 +2557,16 @@

LValue LV = MakeAddrLValue(addr, type, alignment);
LV.getQuals().addCVRQualifiers(cvr);
+ if (TBAAPath) {
+ const ASTRecordLayout &Layout =
+ getContext().getASTRecordLayout(field->getParent());
+ // Set the base type to be the base type of the base LValue and
+ // update offset to be relative to the base type.
+ LV.setTBAABaseType(base.getTBAABaseType());
+ LV.setTBAAOffset(base.getTBAAOffset() +
+ Layout.getFieldOffset(field->getFieldIndex()) /
+ getContext().getCharWidth());
+ }

// __weak attribute on a field is ignored.
if (LV.getQuals().getObjCGCAttr() == Qualifiers::Weak)
Index: lib/CodeGen/CGValue.h
===================================================================
--- lib/CodeGen/CGValue.h (revision 178718)
+++ lib/CodeGen/CGValue.h (working copy)
@@ -157,6 +157,11 @@

Expr *BaseIvarExp;

+ /// Used by struct-path-aware TBAA.
+ QualType TBAABaseType;
+ /// Offset relative to the base type.
+ uint64_t TBAAOffset;
+
/// TBAAInfo - TBAA information to attach to dereferences of this LValue.
llvm::MDNode *TBAAInfo;

@@ -175,6 +180,10 @@
this->ImpreciseLifetime = false;
this->ThreadLocalRef = false;
this->BaseIvarExp = 0;
+
+ // Initialize fields for TBAA.
+ this->TBAABaseType = Type;
+ this->TBAAOffset = 0;
this->TBAAInfo = TBAAInfo;
}

@@ -232,6 +241,12 @@
Expr *getBaseIvarExp() const { return BaseIvarExp; }
void setBaseIvarExp(Expr *V) { BaseIvarExp = V; }

+ QualType getTBAABaseType() const { return TBAABaseType; }
+ void setTBAABaseType(QualType T) { TBAABaseType = T; }
+
+ uint64_t getTBAAOffset() const { return TBAAOffset; }
+ void setTBAAOffset(uint64_t O) { TBAAOffset = O; }
+
llvm::MDNode *getTBAAInfo() const { return TBAAInfo; }
void setTBAAInfo(llvm::MDNode *N) { TBAAInfo = N; }

Index: lib/CodeGen/CodeGenFunction.h
===================================================================
--- lib/CodeGen/CodeGenFunction.h (revision 178718)
+++ lib/CodeGen/CodeGenFunction.h (working copy)
@@ -2211,7 +2211,9 @@
/// the LLVM value representation.
llvm::Value *EmitLoadOfScalar(llvm::Value *Addr, bool Volatile,
unsigned Alignment, QualType Ty,
- llvm::MDNode *TBAAInfo = 0);
+ llvm::MDNode *TBAAInfo = 0,
+ QualType TBAABaseTy = QualType(),
+ uint64_t TBAAOffset = 0);

/// EmitLoadOfScalar - Load a scalar value from an address, taking
/// care to appropriately convert from the memory representation to
@@ -2224,7 +2226,9 @@
/// the LLVM value representation.
void EmitStoreOfScalar(llvm::Value *Value, llvm::Value *Addr,
bool Volatile, unsigned Alignment, QualType Ty,
- llvm::MDNode *TBAAInfo = 0, bool isInit=false);
+ llvm::MDNode *TBAAInfo = 0, bool isInit = false,
+ QualType TBAABaseTy = QualType(),
+ uint64_t TBAAOffset = 0);

/// EmitStoreOfScalar - Store a scalar value to an address, taking
/// care to appropriately convert from the memory representation to
Index: lib/CodeGen/CodeGenModule.cpp
===================================================================
--- lib/CodeGen/CodeGenModule.cpp (revision 178718)
+++ lib/CodeGen/CodeGenModule.cpp (working copy)
@@ -227,6 +227,20 @@
return TBAA->getTBAAStructInfo(QTy);
}

+llvm::MDNode *CodeGenModule::getTBAAStructTypeInfo(QualType QTy) {
+ if (!TBAA)
+ return 0;
+ return TBAA->getTBAAStructTypeInfo(QTy);
+}
+
+llvm::MDNode *CodeGenModule::getTBAAStructTagInfo(QualType BaseTy,
+ llvm::MDNode *AccessN,
+ uint64_t O) {
+ if (!TBAA)
+ return 0;
+ return TBAA->getTBAAStructTagInfo(BaseTy, AccessN, O);
+}
+
void CodeGenModule::DecorateInstruction(llvm::Instruction *Inst,
llvm::MDNode *TBAAInfo) {
Inst->setMetadata(llvm::LLVMContext::MD_tbaa, TBAAInfo);
Index: lib/CodeGen/CodeGenModule.h
===================================================================
--- lib/CodeGen/CodeGenModule.h (revision 178718)
+++ lib/CodeGen/CodeGenModule.h (working copy)
@@ -501,6 +501,11 @@
llvm::MDNode *getTBAAInfo(QualType QTy);
llvm::MDNode *getTBAAInfoForVTablePtr();
llvm::MDNode *getTBAAStructInfo(QualType QTy);
+ /// Return the MDNode in the type DAG for the given struct type.
+ llvm::MDNode *getTBAAStructTypeInfo(QualType QTy);
+ /// Return the path-aware tag for given base type, access node and offset.
+ llvm::MDNode *getTBAAStructTagInfo(QualType BaseTy, llvm::MDNode *AccessN,
+ uint64_t O);

bool isTypeConstant(QualType QTy, bool ExcludeCtorDtor);

Index: lib/CodeGen/CodeGenTBAA.cpp
===================================================================
--- lib/CodeGen/CodeGenTBAA.cpp (revision 178718)
+++ lib/CodeGen/CodeGenTBAA.cpp (working copy)
@@ -21,6 +21,7 @@
#include "clang/AST/Mangle.h"
#include "clang/AST/RecordLayout.h"
#include "clang/Frontend/CodeGenOptions.h"
+#include "llvm/ADT/SmallSet.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
@@ -225,3 +226,87 @@
// For now, handle any other kind of type conservatively.
return StructMetadataCache[Ty] = NULL;
}
+
+/// Check if the given type can be handled by path-aware TBAA.
+static bool isTBAAPathStruct(QualType QTy) {
+ if (const RecordType *TTy = QTy->getAs<RecordType>()) {
+ const RecordDecl *RD = TTy->getDecl()->getDefinition();
+ // RD can be struct, union, class, interface or enum.
+ // For now, we only handle struct.
+ if (RD->isStruct() && !RD->hasFlexibleArrayMember())
+ return true;
+ }
+ return false;
+}
+
+llvm::MDNode *
+CodeGenTBAA::getTBAAStructTypeInfo(QualType QTy) {
+ const Type *Ty = Context.getCanonicalType(QTy).getTypePtr();
+ assert(isTBAAPathStruct(QTy));
+
+ if (llvm::MDNode *N = StructTypeMetadataCache[Ty])
+ return N;
+
+ if (const RecordType *TTy = QTy->getAs<RecordType>()) {
+ const RecordDecl *RD = TTy->getDecl()->getDefinition();
+
+ const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
+ SmallVector <std::pair<uint64_t, llvm::MDNode*>, 4> Fields;
+ // To reduce the size of MDNode for a given struct type, we only output
+ // once for all the fields with the same scalar types.
+ // Offsets for scalar fields in the type DAG are not used.
+ llvm::SmallSet <llvm::MDNode*, 4> ScalarFieldTypes;
+ unsigned idx = 0;
+ for (RecordDecl::field_iterator i = RD->field_begin(),
+ e = RD->field_end(); i != e; ++i, ++idx) {
+ QualType FieldQTy = i->getType();
+ llvm::MDNode *FieldNode;
+ if (isTBAAPathStruct(FieldQTy))
+ FieldNode = getTBAAStructTypeInfo(FieldQTy);
+ else {
+ FieldNode = getTBAAInfo(FieldQTy);
+ // Ignore this field if the type already exists.
+ if (ScalarFieldTypes.count(FieldNode))
+ continue;
+ ScalarFieldTypes.insert(FieldNode);
+ }
+ if (!FieldNode)
+ return StructTypeMetadataCache[Ty] = NULL;
+ Fields.push_back(std::make_pair(
+ Layout.getFieldOffset(idx) / Context.getCharWidth(), FieldNode));
+ }
+
+ // TODO: This is using the RTTI name. Is there a better way to get
+ // a unique string for a type?
+ SmallString<256> OutName;
+ llvm::raw_svector_ostream Out(OutName);
+ MContext.mangleCXXRTTIName(QualType(Ty, 0), Out);
+ Out.flush();
+ // Create the struct type node with a vector of pairs (offset, type).
+ return StructTypeMetadataCache[Ty] =
+ MDHelper.createTBAAStructTypeNode(OutName, Fields);
+ }
+
+ return StructMetadataCache[Ty] = NULL;
+}
+
+llvm::MDNode *
+CodeGenTBAA::getTBAAStructTagInfo(QualType BaseQTy, llvm::MDNode *AccessNode,
+ uint64_t Offset) {
+ if (!CodeGenOpts.StructPathTBAA)
+ return AccessNode;
+
+ const Type *BTy = Context.getCanonicalType(BaseQTy).getTypePtr();
+ TBAAPathTag PathTag = TBAAPathTag(BTy, AccessNode, Offset);
+ if (llvm::MDNode *N = StructTagMetadataCache[PathTag])
+ return N;
+
+ llvm::MDNode *BNode = 0;
+ if (isTBAAPathStruct(BaseQTy))
+ BNode = getTBAAStructTypeInfo(BaseQTy);
+ if (!BNode)
+ return StructTagMetadataCache[PathTag] = AccessNode;
+
+ return StructTagMetadataCache[PathTag] =
+ MDHelper.createTBAAStructTagNode(BNode, AccessNode, Offset);
+}
Index: lib/CodeGen/CodeGenTBAA.h
===================================================================
--- lib/CodeGen/CodeGenTBAA.h (revision 178718)
+++ lib/CodeGen/CodeGenTBAA.h (working copy)
@@ -35,6 +35,14 @@
namespace CodeGen {
class CGRecordLayout;

+ struct TBAAPathTag {
+ TBAAPathTag(const Type *B, const llvm::MDNode *A, uint64_t O)
+ : BaseT(B), AccessN(A), Offset(O) {}
+ const Type *BaseT;
+ const llvm::MDNode *AccessN;
+ uint64_t Offset;
+ };
+
/// CodeGenTBAA - This class organizes the cross-module state that is used
/// while lowering AST types to LLVM types.
class CodeGenTBAA {
@@ -46,8 +54,13 @@
// MDHelper - Helper for creating metadata.
llvm::MDBuilder MDHelper;

- /// MetadataCache - This maps clang::Types to llvm::MDNodes describing them.
+ /// MetadataCache - This maps clang::Types to scalar llvm::MDNodes describing
+ /// them.
llvm::DenseMap<const Type *, llvm::MDNode *> MetadataCache;
+ /// This maps clang::Types to a struct node in the type DAG.
+ llvm::DenseMap<const Type *, llvm::MDNode *> StructTypeMetadataCache;
+ /// This maps TBAAPathTags to a tag node.
+ llvm::DenseMap<TBAAPathTag, llvm::MDNode *> StructTagMetadataCache;

/// StructMetadataCache - This maps clang::Types to llvm::MDNodes describing
/// them for struct assignments.
@@ -89,9 +102,49 @@
/// getTBAAStructInfo - Get the TBAAStruct MDNode to be used for a memcpy of
/// the given type.
llvm::MDNode *getTBAAStructInfo(QualType QTy);
+
+ /// Get the MDNode in the type DAG for given struct type QType.
+ llvm::MDNode *getTBAAStructTypeInfo(QualType QType);
+ /// Get the tag MDNode for a given base type, the actual sclar access MDNode
+ /// and offset into the base type.
+ llvm::MDNode *getTBAAStructTagInfo(QualType BaseQType,
+ llvm::MDNode *AccessNode, uint64_t Offset);
};

} // end namespace CodeGen
} // end namespace clang

+namespace llvm {
+
+template<> struct DenseMapInfo<clang::CodeGen::TBAAPathTag> {
+ static clang::CodeGen::TBAAPathTag getEmptyKey() {
+ return clang::CodeGen::TBAAPathTag(
+ DenseMapInfo<const clang::Type *>::getEmptyKey(),
+ DenseMapInfo<const MDNode *>::getEmptyKey(),
+ DenseMapInfo<uint64_t>::getEmptyKey());
+ }
+
+ static clang::CodeGen::TBAAPathTag getTombstoneKey() {
+ return clang::CodeGen::TBAAPathTag(
+ DenseMapInfo<const clang::Type *>::getTombstoneKey(),
+ DenseMapInfo<const MDNode *>::getTombstoneKey(),
+ DenseMapInfo<uint64_t>::getTombstoneKey());
+ }
+
+ static unsigned getHashValue(const clang::CodeGen::TBAAPathTag &Val) {
+ return DenseMapInfo<const clang::Type *>::getHashValue(Val.BaseT) ^
+ DenseMapInfo<const MDNode *>::getHashValue(Val.AccessN) ^
+ DenseMapInfo<uint64_t>::getHashValue(Val.Offset);
+ }
+
+ static bool isEqual(const clang::CodeGen::TBAAPathTag &LHS,
+ const clang::CodeGen::TBAAPathTag &RHS) {
+ return LHS.BaseT == RHS.BaseT &&
+ LHS.AccessN == RHS.AccessN &&
+ LHS.Offset == RHS.Offset;
+ }
+};
+
+} // end namespace llvm
+
#endif
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp (revision 178718)
+++ lib/Driver/Tools.cpp (working copy)
@@ -2105,6 +2105,8 @@
options::OPT_fno_strict_aliasing,
getToolChain().IsStrictAliasingDefault()))
CmdArgs.push_back("-relaxed-aliasing");
+ if (Args.hasArg(options::OPT_fstruct_path_tbaa))
+ CmdArgs.push_back("-struct-path-tbaa");
if (Args.hasFlag(options::OPT_fstrict_enums, options::OPT_fno_strict_enums,
false))
CmdArgs.push_back("-fstrict-enums");
Index: lib/Frontend/CompilerInvocation.cpp
===================================================================
--- lib/Frontend/CompilerInvocation.cpp (revision 178718)
+++ lib/Frontend/CompilerInvocation.cpp (working copy)
@@ -324,6 +324,7 @@
Opts.UseRegisterSizedBitfieldAccess = Args.hasArg(
OPT_fuse_register_sized_bitfield_access);
Opts.RelaxedAliasing = Args.hasArg(OPT_relaxed_aliasing);
+ Opts.StructPathTBAA = Args.hasArg(OPT_struct_path_tbaa);
Opts.DwarfDebugFlags = Args.getLastArgValue(OPT_dwarf_debug_flags);
Opts.MergeAllConstants = !Args.hasArg(OPT_fno_merge_all_constants);
Opts.NoCommon = Args.hasArg(OPT_fno_common);
Index: test/CodeGen/tbaa.cpp
===================================================================
--- test/CodeGen/tbaa.cpp (revision 0)
+++ test/CodeGen/tbaa.cpp (working copy)
@@ -0,0 +1,217 @@
+// RUN: %clang_cc1 -O1 -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -O1 -struct-path-tbaa -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s -check-prefix=PATH
+// Test TBAA metadata generated by front-end.
+
+#include <stdint.h>
+typedef struct
+{
+ uint16_t f16;
+ uint32_t f32;
+ uint16_t f16_2;
+ uint32_t f32_2;
+} StructA;
+typedef struct
+{
+ uint16_t f16;
+ StructA a;
+ uint32_t f32;
+} StructB;
+typedef struct
+{
+ uint16_t f16;
+ StructB b;
+ uint32_t f32;
+} StructC;
+typedef struct
+{
+ uint16_t f16;
+ StructB b;
+ uint32_t f32;
+ uint8_t f8;
+} StructD;
+
+typedef struct
+{
+ uint16_t f16;
+ uint32_t f32;
+} StructS;
+typedef struct
+{
+ uint16_t f16;
+ uint32_t f32;
+} StructS2;
+
+uint32_t g(uint32_t *s, StructA *A, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !5
+ *s = 1;
+ A->f32 = 4;
+ return *s;
+}
+
+uint32_t g2(uint32_t *s, StructA *A, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa !8
+ *s = 1;
+ A->f16 = 4;
+ return *s;
+}
+
+uint32_t g3(StructA *A, StructB *B, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !9
+ A->f32 = 1;
+ B->a.f32 = 4;
+ return A->f32;
+}
+
+uint32_t g4(StructA *A, StructB *B, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa !11
+ A->f32 = 1;
+ B->a.f16 = 4;
+ return A->f32;
+}
+
+uint32_t g5(StructA *A, StructB *B, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !12
+ A->f32 = 1;
+ B->f32 = 4;
+ return A->f32;
+}
+
+uint32_t g6(StructA *A, StructB *B, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !13
+ A->f32 = 1;
+ B->a.f32_2 = 4;
+ return A->f32;
+}
+
+uint32_t g7(StructA *A, StructS *S, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !14
+ A->f32 = 1;
+ S->f32 = 4;
+ return A->f32;
+}
+
+uint32_t g8(StructA *A, StructS *S, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa !16
+ A->f32 = 1;
+ S->f16 = 4;
+ return A->f32;
+}
+
+uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !14
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !17
+ S->f32 = 1;
+ S2->f32 = 4;
+ return S->f32;
+}
+
+uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !14
+// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa !19
+ S->f32 = 1;
+ S2->f16 = 4;
+ return S->f32;
+}
+
+uint32_t g11(StructC *C, StructD *D, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !20
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !22
+ C->b.a.f32 = 1;
+ D->b.a.f32 = 4;
+ return C->b.a.f32;
+}
+
+uint32_t g12(StructC *C, StructD *D, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// TODO: differentiate the two accesses.
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !9
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !9
+ StructB *b1 = &(C->b);
+ StructB *b2 = &(D->b);
+ // b1, b2 have different context.
+ b1->a.f32 = 1;
+ b2->a.f32 = 4;
+ return b1->a.f32;
+}
+
+// CHECK: !1 = metadata !{metadata !"omnipotent char", metadata !2}
+// CHECK: !2 = metadata !{metadata !"Simple C/C++ TBAA"}
+// CHECK: !4 = metadata !{metadata !"int", metadata !1}
+// CHECK: !5 = metadata !{metadata !"short", metadata !1}
+
+// PATH: !1 = metadata !{metadata !"omnipotent char", metadata !2}
+// PATH: !4 = metadata !{metadata !"int", metadata !1}
+// PATH: !5 = metadata !{metadata !6, metadata !4, i64 4}
+// PATH: !6 = metadata !{metadata !"_ZTS7StructA", i64 0, metadata !7, i64 4, metadata !4}
+// PATH: !7 = metadata !{metadata !"short", metadata !1}
+// PATH: !8 = metadata !{metadata !6, metadata !7, i64 0}
+// PATH: !9 = metadata !{metadata !10, metadata !4, i64 8}
+// PATH: !10 = metadata !{metadata !"_ZTS7StructB", i64 0, metadata !7, i64 4, metadata !6, i64 20, metadata !4}
+// PATH: !11 = metadata !{metadata !10, metadata !7, i64 4}
+// PATH: !12 = metadata !{metadata !10, metadata !4, i64 20}
+// PATH: !13 = metadata !{metadata !10, metadata !4, i64 16}
+// PATH: !14 = metadata !{metadata !15, metadata !4, i64 4}
+// PATH: !15 = metadata !{metadata !"_ZTS7StructS", i64 0, metadata !7, i64 4, metadata !4}
+// PATH: !16 = metadata !{metadata !15, metadata !7, i64 0}
+// PATH: !17 = metadata !{metadata !18, metadata !4, i64 4}
+// PATH: !18 = metadata !{metadata !"_ZTS8StructS2", i64 0, metadata !7, i64 4, metadata !4}
+// PATH: !19 = metadata !{metadata !18, metadata !7, i64 0}
+// PATH: !20 = metadata !{metadata !21, metadata !4, i64 12}
+// PATH: !21 = metadata !{metadata !"_ZTS7StructC", i64 0, metadata !7, i64 4, metadata !10, i64 28, metadata !4}
+// PATH: !22 = metadata !{metadata !23, metadata !4, i64 12}
+// PATH: !23 = metadata !{metadata !"_ZTS7StructD", i64 0, metadata !7, i64 4, metadata !10, i64 28, metadata !4, i64 32, metadata !1}


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
efb72adbae0c253fc2fd9127fb3e1c36cb1b8d93 01-Apr-2013 Adrian Prantl <aprantl@apple.com> * Attempt to un-break gdb buildbot by emitting a lexical block end only
when we actually end a lexical block.
* Added new test for line table / block cleanup.
* Follow-up to r177819 / rdar://problem/13115369

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
495cfa46300979642acde8d93a1f21c9291dac98 23-Mar-2013 Nadav Rotem <nrotem@apple.com> Make clang to mark static stack allocations with lifetime markers to enable a more aggressive stack coloring.
Patch by John McCall with help by Shuxin Yang.
rdar://13115369



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b6a6079449a5275c283982e19b0c38e165833bb2 23-Mar-2013 John McCall <rjmccall@apple.com> Under ARC, when we're passing the address of a strong variable
to an out-parameter using the indirect-writeback conversion,
and we copied the current value of the variable to the temporary,
make sure that we register an intrinsic use of that value with
the optimizer so that the value won't get released until we have
a chance to retain it.

rdar://13195034

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
63fd408a61ae9b94e8d8a986832f526f7cdbfa84 20-Mar-2013 Manman Ren <mren@apple.com> Exploit this-return of a callsite in a this-return function.

For constructors/desctructors that return 'this', if there exists a callsite
that returns 'this' and is immediately before the return instruction, make
sure we are using the return value from the callsite.

We don't need to keep 'this' alive through the callsite. It also enables
optimizations in the backend, such as tail call optimization.

Updated from r177211.
rdar://12818789


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7cd84baa533ae337e3eb6b7951d94ce94093d521 16-Mar-2013 Manman Ren <mren@apple.com> revert r177211 due to its potential issues

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2710ed8fd997be04ff447b8be2190f8fb34ac22b 16-Mar-2013 Manman Ren <mren@apple.com> Exploit this-return of a callsite in a this-return function.

For constructors/desctructors that return 'this', if there exists a callsite
that returns 'this' and is immediately before the return instruction, make
sure we are using the return value from the callsite.

We don't need to keep 'this' alive through the callsite. It also enables
optimizations in the backend, such as tail call optimization.

rdar://12818789


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5b07e8077a20b80fee90bd76c43c6150c676e4a8 13-Mar-2013 John McCall <rjmccall@apple.com> Tighten up the rules for precise lifetime and document
the requirements on the ARC optimizer.

rdar://13407451

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
37453b9580e293eef3bd60bd36047a93ac4515b1 08-Mar-2013 Joey Gouly <joey.gouly@arm.com> Add support for the OpenCL attribute 'vec_type_hint'.

Patch by Murat Bolat!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9eda3abe7e183b05834947391c0cdc291f4ee0d8 07-Mar-2013 John McCall <rjmccall@apple.com> Promote atomic type sizes up to a power of two, capped by
MaxAtomicPromoteWidth. Fix a ton of terrible bugs with
_Atomic types and (non-intrinsic-mediated) loads and stores
thereto.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9d232c884ea9872d6555df0fd7359699819bc1f1 07-Mar-2013 John McCall <rjmccall@apple.com> Change hasAggregateLLVMType, which conflates complex and
aggregate types in a profoundly wrong way that has to be
worked around in every call site, to getEvaluationKind,
which classifies and distinguishes between all of these
cases.

Also, normalize the API for loading and storing complexes.

I'm working on a larger patch and wanted to pull these
changes out, but it would have be annoying to detangle
them from each other.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4a68c7bc86bcaf44f6aee5a470c743b47c11716e 01-Mar-2013 John McCall <rjmccall@apple.com> Restore order to placate test. I had no real reason to switch them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ed383135bcffdb8849418896b742fbca7fa2b787 01-Mar-2013 John McCall <rjmccall@apple.com> Re-use bit from superclass and extract stuff into a local
function. Serves a patch we're kicking around out-of-tree.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bd7370a78604e9a20d698bfe328c1e43f12a0613 28-Feb-2013 John McCall <rjmccall@apple.com> Use the actual ABI-determined C calling convention for runtime
calls and declarations.

LLVM has a default CC determined by the target triple. This is
not always the actual default CC for the ABI we've been asked to
target, and so we sometimes find ourselves annotating all user
functions with an explicit calling convention. Since these
calling conventions usually agree for the simple set of argument
types passed to most runtime functions, using the LLVM-default CC
in principle has no effect. However, the LLVM optimizer goes
into histrionics if it sees this kind of formal CC mismatch,
since it has no concept of CC compatibility. Therefore, if this
module happens to define the "runtime" function, or got LTO'ed
with such a definition, we can miscompile; so it's quite
important to get this right.

Defining runtime functions locally is quite common in embedded
applications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1d4fff5551c2347010b955b4337a2aa7d65a050e 27-Feb-2013 Timur Iskhodzhanov <timurrrr@google.com> Better support for constructors with -cxx-abi microsoft, partly fixes PR12784

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a0a628f839cf50844cc0f226bd9cb72485f98f91 23-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> ubsan: Emit bounds checks for array indexing, vector indexing, and (in really simple cases) pointer arithmetic. This augments the existing bounds checking with language-level array bounds information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
56c00c4868831c9a137ca7b0e16d063cf986d110 17-Feb-2013 Lang Hames <lhames@gmail.com> Re-apply r174919 - smarter copy/move assignment/construction, with fixes for
bitfield related issues.

The original commit broke Takumi's builder. The bug was caused by bitfield sizes
being determined by their underlying type, rather than the field info. A similar
issue with bitfield alignments showed up on closer testing. Both have been fixed
in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c764830bdb6de82baed068889096bd3e52d4cbda 13-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> ubsan: Add checking for invalid downcasts. Per [expr.static.cast]p2 and p11,
base-to-derived casts have undefined behavior if the object is not actually an
instance of the derived type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
59660c21178b6af518bd4b564e032d5c9cc218cb 13-Feb-2013 Timur Iskhodzhanov <timurrrr@google.com> Emit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c2808e705eb8a1a825a5807cabc16d55052c31bd 12-Feb-2013 Lang Hames <lhames@gmail.com> Backing out r174919 while I investigate a self-host bug on Takumi's builder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5310859d0dcec2f3efbeb155ae1cfee14bdd2836 12-Feb-2013 Lang Hames <lhames@gmail.com> When generating IR for default copy-constructors, copy-assignment operators,
move-constructors and move-assignment operators, use memcpy to copy adjacent
POD members.

Previously, classes with one or more Non-POD members would fall back on
element-wise copies for all members, including POD members. This often
generated a lot of IR. Without padding metadata, it wasn't often possible
for the LLVM optimizers to turn the element-wise copies into a memcpy.

This code hasn't yet received any serious tuning. I didn't see any serious
regressions on a self-hosted clang build, or any of the nightly tests, but
I think it's important to get this out in the wild to get more testing.
Insights, feedback and comments welcome.

Many thanks to David Blaikie, Richard Smith, and especially John McCall for
their help and feedback on this work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8fcbb8dfbc28b6279d22144e10ade401a6c03e9e 05-Feb-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> Fix typo in comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0a0f93c90fd397a1aa9f97283c55f8ba0062bf55 01-Feb-2013 David Blaikie <dblaikie@gmail.com> Fix exception handling line table problems introduced by r173593

r173593 made us a little too eager to associate all code at the end of a
function with the user-written 'return' line. This caused problems with
breakpoints as they'd be set in exception handling code preceeding the
actual non-exception return handling code, leading to the breakpoint never
being hit in non-exceptional execution.

This change restores the pre-r173593 exception handling line information where
the cleanup code is associated with the '}' not the return line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
074cae0861a87bf96d8ea56d02e34839d9ccbd0a 01-Feb-2013 John McCall <rjmccall@apple.com> Destroy arrays and ARC fields when throwing out of ctors.

Previously we were only handling non-array fields of class type.

Testcases derived from a patch by WenHan Gu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
378e1e739aed97e9b278beeb20e9f5bbe34c0232 31-Jan-2013 Douglas Gregor <dgregor@apple.com> When we're emitting a constructor or destructor call from a delegating
constructor, retrieve our VTT parameter directly. Fixes PR14588 /
<rdar://problem/12867962>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
78d85b1c5830a881c0a20a1b3fea99ee73149590 30-Jan-2013 Chad Rosier <mcrosier@apple.com> [ubsan] Implement the -fcatch-undefined-behavior flag using a trapping
implementation; this is much more inline with the original implementation
(i.e., pre-ubsan) and does not require run-time library support.

The trapping implementation can be invoked using either '-fcatch-undefined-behavior'
or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error', with the latter
being preferred. Eventually, the -fcatch-undefined-behavior' flag will be removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a6504853d297c30cfa271f4710af5a3d5db59449 26-Jan-2013 David Blaikie <dblaikie@gmail.com> PR14566: Debug Info: avoid top level lexical blocks in functions

One of the gotchas (see changes to CodeGenFunction) was due to the fix in
r139416 (for PR10829). This only worked previously because the top level
lexical block would set the location to the end of the function, the debug
location would be updated (as per r139416), the location would be set to
the end of the function again (but that would no-op, since it was the same
as the previous location), then the return instruction would be emitted using
the debug location.

Once the top level lexical block was no longer emitted, the end-of-function
location change was causing the debug loc to be updated, regressing that bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3ac83d69c61238cd0d38e90fcdd03390530ab2fb 26-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> patch for PR9027 and // rdar://11861085
Title: [PR9027] volatile struct bug: member is not loaded at -O;
This is caused by last flag passed to @llvm.memcpy being false,
not honoring that aggregate has at least one 'volatile' data member
(even though aggregate itself has not been qualified as 'volatile'.
As a result, optimization optimizes away the memcpy altogether.
Patch review by John MaCall (I still need to fix up a test though).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173535 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4f45bc099f2665bc6e4bcbb169aa452390dbf3fe 18-Jan-2013 Will Dietz <wdietz2@illinois.edu> [ubsan] Add support for -fsanitize-blacklist

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
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/CodeGenFunction.h
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/CodeGenFunction.h
ad95481b2769ad61f23afc5e2c31f11c66090657 02-Dec-2012 Will Dietz <wdietz2@illinois.edu> [ubsan] Add flag to enable recovery from checks when possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c686004145b1f4dbeb38173a0886ba7040ae0089 07-Nov-2012 David Chisnall <csdavec@swan.ac.uk> Fix the Objective-C exception rethrow from cleanups (GNU runtimes). Note that
a bug in the inliner still causes the wrong thing to happen at -O2 and above
(PR14116).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d6396a681c9acbe56bc41bbc2bed2db45755bcd7 05-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Use the individual -fsanitize=<...> arguments to control which of the UBSan
checks to enable. Remove frontend support for -fcatch-undefined-behavior,
-faddress-sanitizer and -fthread-sanitizer now that they don't do anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
cc305617e952f8c3a06b63d9225d0dd7769341b7 01-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Split emission of -ftrapv checks and -fcatch-undefined-behavior checks into
separate functions, since they share essentially no code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8e1cee6f23e2552b96b81e5ef419ab3f69c5b5c2 25-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> -fcatch-undefined-behavior checking for appropriate vptr value: Clang CodeGen side.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
015f33b6741ffceba3a71ee2d71d46418a7dc34c 17-Oct-2012 John McCall <rjmccall@apple.com> At -O0, prefer objc_storeStrong with a null new value to the
combination of a load+objc_release; this is generally better
for tools that try to track why values are retained and
released. Also use objc_storeStrong when copying a block
(again, only at -O0), which requires us to do a preliminary
store of null in order to compensate for objc_storeStrong's
assign semantics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a240df2ec1b374b3e9e7f760875ffb17cd64506f 16-Oct-2012 Alexey Samsonov <samsonov@google.com> Transform pattern:
if (CGM.getModuleDebugInfo())
DebugInfo = CGM.getModuleDebugInfo()
into a call:
maybeInitializeDebugInfo();

This is a simplification for a possible future fix of PR13942.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
4def70d3040e73707c738f7c366737a986135edf 09-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> -fcatch-undefined-behavior: emit calls to the runtime library whenever one of the checks fails.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6cacae8bf9597b8124cd40aedc189c04484e1990 30-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> CodeGen: Copy tail padding when we're not dealing with a trivial copy assign or move assign operator.

This fixes a regression from r162254, the optimizer has problems reasoning
about the smaller memcpy as it's often not safe to widen a store but making it
smaller is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f3477c13eeaf11b32a41f181398fb5deffd0dd73 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org> Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
94ff8e1f57c6382d91d0de981a4f311509d83e37 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo 'iff' => 'if'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f56faa01936b9cf909623d7f06e3c2569ca4a78e 15-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7ac9ef1c82c779a5348ed11b3d10e01c58803b35 08-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> -fcatch-undefined-behavior: Factor emission of the creation of, and branch to,
the trap BB out of the individual checks and into a common function, to prepare
for making this code call into a runtime library. Rename the existing EmitCheck
to EmitTypeCheck to clarify it and to move it out of the way of the new
EmitCheck.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d1a8d2ef757ad880d48b2249a1619bf8209e9cf8 28-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Have MSAsmStmts use the generic EmitAsmStmt codegen function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a23b91d542e336be5051ac54f394e860fb756911 28-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Rename EmitGCCAsmStmt to EmitAsmStmt and have it accept
AsmStmts. This function is only used by GCCAsmStmts, however. Constraints need
to be properly computed before MSAsmStmts can use EmitAsmStmt. No functional
change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
df5faf5e7ae6823d0af0b801c4ac26d47f2cee97 25-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] As part of a larger refactoring, rename AsmStmt to GCCAsmStmt.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2c9f87ca5cccbfdaad82762368af5b2323320653 24-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> New -fcatch-undefined-behavior features:
* when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check
* check that references are bound to appropriate storage
* check that 'this' has appropriate storage in member accesses and member function calls


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
42b60551eff3a424e191b293bfd606559dc96bff 23-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Remove an unused argument. This logic can now be reused by the
ms-style inline asms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
70517ca5c07c4b41ff8662b94ee22047b0299f8c 23-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix a bunch of -Wdocumentation warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ea93e40785ffeadfac66b948c95f9490ec26207a 23-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Use the alignment from lvalue emission to more accurately compute the alignment
of a pointer for builtin emission, instead of just depending on the type of the
pointee. <rdar://problem/11314941>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
859c65cdbe730fd0e940b71ab4ba4884d44a8298 08-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Fix an assertion failure with a C++ constructor initializing a
member of reference type in an anonymous struct. PR13154.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161473 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e1ecdc168175719d74e112bcacd4aae5e12d4631 23-Jul-2012 Richard Trieu <rtrieu@google.com> Change APInt to APSInt in one instance. Also change a call to operator==() to
APSInt::isSameValue() when comparing different sized APSInt's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e87f3f62bcbe8bc562c1623c9e8bb49cf31c0460 17-Jul-2012 Simon Atanasyan <satanasyan@mips.com> Revert commit r160308. We decide to move builtins selection to the backend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d7bad053b048494db5f83b512a5169d01be96f81 16-Jul-2012 Simon Atanasyan <satanasyan@mips.com> MIPS: Implement __builtin_mips_shll_qb builtin function overloading.
This function has two versions. The first one is used for a register operand.
The second one is used for an immediate number.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c852e9ff06f7089405265c53af33cf06fdc36e52 11-Jul-2012 Eric Christopher <echristo@apple.com> Temporarily revert this to see if it brings the gdb bot back.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3d40f96394fb30b70ba83bdfd10f3ed69530b0e5 11-Jul-2012 Eric Christopher <echristo@apple.com> The end of a block doesn't necessarily need a line table entry unless
there's something going on there. Remove the unconditional line entry
and only add one if we're emitting cleanups (any other statements
would be handled normally).

Fixes rdar://9199234

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0df579ec000ffe52e0cddf1e7ee5e50a55256835 10-Jul-2012 Tanya Lattner <tonic@nondot.org> Patch by Anton Lokhmotov to add OpenCL work group size attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e0c1168ec7910a1a7ed08df4d4f0c58c2fa2ecd1 03-Jul-2012 John McCall <rjmccall@apple.com> Significantly simplify CGExprAgg's logic about ignored results:
if we want to ignore a result, the Dest will be null. Otherwise,
we must copy into it. This means we need to ensure a slot when
loading from a volatile l-value.

With all that in place, fix a bug with chained assignments into
__block variables of aggregate type where we were losing insight into
the actual source of the value during the second assignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1d2b2ca97686b1ed16b1614e4700f9d2a0938a71 28-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Dead code eliminate the massive hexagon builtin intrinsic supporting code.

The tablegen'd code does the same thing without this egregious duplication.
In my limited testing everything seems to work, however there can be
differences if the clang and llvm builtin definitions don't match.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
fbf7005138d199bad238f0dd1ff509931a24ab10 28-Jun-2012 Simon Atanasyan <satanasyan@mips.com> Support MIPS DSP Rev1 intrinsics.
This patch was reviewed in the llvm-commits list by Jim Grosbach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f4bcfa1b1850711d5eb092f2b0639331ef9f09f1 27-Jun-2012 Eli Friedman <eli.friedman@gmail.com> Propagate lvalue alignment into bitfields. Per report on cfe-dev.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159295 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4904bf4e84cfb48080270ebaa9005327f18ab0e5 26-Jun-2012 Fariborz Jahanian <fjahanian@apple.com> block literal irgen: several improvements on naming block
literal helper functions. All helper functions (global
and locals) use block_invoke as their prefix. Local literal
helper names are prefixed by their enclosing mangled function
names. Blocks in non-local initializers (e.g. a global variable
or a C++11 field) are prefixed by their mangled variable name.
The descriminator number added to end of the name starts off
with blank (for first block) and _<N> (for the N+2-th block).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8cd64b4c5553fa6284d248336cb7c82dc960a394 11-Jun-2012 Chad Rosier <mcrosier@apple.com> Etch out the code path for MS-style inline assembly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
490a52b4947381879a47b4251db5fb81cdf5d02b 29-May-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: fix a sema and IRGen crash when property
getter result type is safe but does not match with property
type resulting in spurious warning followed by crash in
IRGen. // rdar://11515196


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
13ec9100ca6bc03b5ce8832e4a0fcb724d47bcb1 14-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement IRGen for C++11's "T{1, 2, 3}", where T is an aggregate and the
expression is treated as an lvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b3198a841e7f356f171f1e11faff014b2deb1eb8 09-May-2012 Nuno Lopes <nunoplopes@sapo.pt> add -fbounds-checking option.
When enabled, clang generates bounds checks for array and pointers dereferences. Work to follow in LLVM's backend.

OK'ed by Chad; thanks for the review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
20bb175cb8ae5844034828db094fb948c0e3454a 01-May-2012 John McCall <rjmccall@apple.com> Abstract the emission of global destructors into ABI-specific code
and only consider using __cxa_atexit in the Itanium logic. The
default logic is to use atexit().

Emit "guarded" initializers in Microsoft mode unconditionally.
This is definitely not correct, but it's closer to correct than
just not emitting the initializer.

Based on a patch by Timur Iskhodzhanov!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
eb382ec1507cf2c8c12d7443d0b67c076223aec6 19-Apr-2012 Patrick Beard <pcbeard@mac.com> Implements boxed expressions for Objective-C. <rdar://problem/10194391>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
377ecc7996dce6803f7b7b6208cab5e197c9c5b8 16-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Propagate alignment on lvalues through EmitLValueForField. PR12395.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
534986f2b21e6050bf00163cd6423fd92155a6ed 14-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add an AttributedStmt type to represent a statement with C++11 attributes
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.

Patch by Alexander Kornienko!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
eaf856db5d1a272dc7188937206ef4572836f82a 13-Apr-2012 Anton Korobeynikov <asl@math.spbu.ru> Step forward with supporting of ARM homogenous aggregates:
- Handle unions
- Handle C++ classes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8250016fb9491fcfde7fce05230d66e267944484 10-Apr-2012 Duncan Sands <baldrick@free.fr> Express the number of ULPs in fpaccuracy metadata as a real rather than a
rational number, eg as 2.5 rather than 5, 2. OK'd by Peter Collingbourne.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3f88f686e32949ffe02ccb551f482f9cf810358b 06-Apr-2012 John McCall <rjmccall@apple.com> Rename GenerateCXXGlobalDtorFunc to GenerateCXXGlobalDtorsFunc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0f30a12ce7b3d4d86c9ca9072f587da77c8eef34 30-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Revert r153723, and its follow-ups r153728 and r153733.

These patches cause us to miscompile and/or reject code with static
function-local variables in an extern-C context. Previously, we were
papering over this as long as the variables are within the same
translation unit, and had not seen any failures in the wild. We still
need a proper fix, which involves mangling static locals inside of an
extern-C block (as GCC already does), but this patch causes pretty
widespread regressions. Firefox, and many other applications no longer
build.

Lots of test cases have been posted to the list in response to this
commit, so there should be no problem reproducing the issues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
49d26d2817180ccde605c987f79cd3a5b57639cd 30-Mar-2012 John McCall <rjmccall@apple.com> Do the static-locals thing properly in the face of unions and
other things which might mess with the variable's type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
649b4a1a9b5e6f768ca0cb84bd97b00f51083e15 29-Mar-2012 Chad Rosier <mcrosier@apple.com> Revert r153613 as it's causing large compile-time regressions on the nightly testers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
57cd1b89cd91433ce1991a5bff36fe776a263796 29-Mar-2012 John McCall <rjmccall@apple.com> When we can't prove that the target of an aggregate copy is
a complete object, the memcpy needs to use the data size of
the structure instead of its sizeof() value. Fixes PR12204.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c3f8955d7da1019dbe16b0bdf3e49d2e08d988e9 24-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Add back r153360 with a fix for enums that cover all the 32 bit values.
Thanks to NAKAMURA Takumi for finding it!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
88a569a9781e0472a1f1c392f6c94ed0c068d946 24-Mar-2012 NAKAMURA Takumi <geek4civic@gmail.com> Revert r153360 (and r153380), "Second part of PR12251. Produce the range metadata in clang for booleans and".

For i686 targets (eg. cygwin), I saw "Range must not be empty!" in verifier.

It produces (i32)[0x80000000:0x80000000) from (uint64_t)[0xFFFFFFFF80000000ULL:0x0000000080000000ULL), for signed i32 on MDNode::Range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e27af29401da15cc2e9a92825cb24adb1aef7091 24-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Second part of PR12251. Produce the range metadata in clang for booleans and
c++ enums.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153360 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f4b88a45902af1802a1cb42ba48b1c474474f228 10-Mar-2012 John McCall <rjmccall@apple.com> Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context. I'm amenable to suggestions about the exact meaning
of this bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
dd2ecee313b558a9b621ec003b45e0fbc83508d7 10-Mar-2012 John McCall <rjmccall@apple.com> Unify the BlockDeclRefExpr and DeclRefExpr paths so that
we correctly emit loads of BlockDeclRefExprs even when they
don't qualify as ODR-uses. I think I'm adequately convinced
that BlockDeclRefExpr can die.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ebcb57a8d298862c65043e88b2429591ab3c58d3 06-Mar-2012 Ted Kremenek <kremenek@apple.com> Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,
NSNumber, and boolean literals. This includes both Sema and Codegen support.
Included is also support for new Objective-C container subscripting.

My apologies for the large patch. It was very difficult to break apart.
The patch introduces changes to the driver as well to cause clang to link
in additional runtime support when needed to support the new language features.

Docs are forthcoming to document the implementation and behavior of these features.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f4c3db175101cbf94dad59419c3ed7aed51bf606 02-Mar-2012 Jay Foad <jay.foad@gmail.com> PR12094: Set the alignment of memory intrinsic instructions based on the
types of the pointer arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
23f0267e2d56c0407f12e62df3561ecf75d74e6e 01-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Implement "optimization" for lambda-to-block conversion which inlines the generated block literal for lambdas which are immediately converted to block pointer type. This simplifies the AST, avoids an unnecessary copy of the lambda and makes it much easier to avoid copying the result onto the heap.

Note that this transformation has a substantial semantic effect outside of ARC: it gives the converted lambda lifetime semantics similar to a block literal. With ARC, the effect is much less obvious because the lifetime of blocks is already managed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
cae40c4d448529fe65de3d87bdbe97d3b54b4d98 28-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Implement IRGen for the retain-autorelease in the lambda conversion-to-block-pointer outside of ARC. Testcases coming up soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
64bee65a3436e3f0c352fcfe2130676f3502cffe 25-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Work-in-progress for lambda conversion-to-block operator. Still need to implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
795b10062c2eaffae9e04241fb1a73cdbcb24a37 22-Feb-2012 Bill Wendling <isanbard@gmail.com> Use an ArrayRef when we can instead of passing in a SmallVectorImpl reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
972edf0534d8a50f87fac1d0ff34eb22f593df11 19-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Make heap-allocation of std::initializer_list 'work'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
af130fd78267ee9e2395b758a7d827b07ce317a0 19-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Get recursive initializer lists to work and add a test. Codegen of std::initializer_list is now complete. Onward to array new.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
32cf1f27ae8620e7b79bb4e81a067187c0aab7ae 17-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Basic code generation support for std::initializer_list.

We now generate temporary arrays to back std::initializer_list objects
initialized with braces. The initializer_list is then made to point at
the array. We support both ptr+size and start+end forms, although
the latter is untested.

Array lifetime is correct for temporary std::initializer_lists (e.g.
call arguments) and local variables. It is untested for new expressions
and member initializers.

Things left to do:
Massively increase the amount of testing. I need to write tests for
start+end init lists, temporary objects created as a side effect of
initializing init list objects, new expressions, member initialization,
creation of temporary objects (e.g. std::vector) for initializer lists,
and probably more.
Get lifetime "right" for member initializers and new expressions. Not
that either are very useful.
Implement list-initialization of array new expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
27dd7d962bbf774988bc5e59d04a7743ed503514 17-Feb-2012 Douglas Gregor <dgregor@apple.com> Rework the Sema/AST/IRgen dance for the lambda closure type's
conversion to function pointer. Rather than having IRgen synthesize
the body of this function, we instead introduce a static member
function "__invoke" with the same signature as the lambda's
operator() in the AST. Sema then generates a body for the conversion
to function pointer which simply returns the address of __invoke. This
approach makes it easier to evaluate a call to the conversion function
as a constant, makes the linkage of the __invoke function follow the
normal rules for member functions, and may make life easier down the
road if we ever want to constexpr'ify some of lambdas.

Note that IR generation is responsible for filling in the body of
__invoke (Sema just adds a dummy body), because the body can't
generally be expressed in C++.

Eli, please review!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
21f6ed94b929beea31622f5e6b3890e51293cfad 16-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Initial implementation of IRGen for the lambda conversion-to-function-pointer operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bd89f8c2caa9550e41daa1aa9bf30f0f1e0dfaf7 16-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Start of IRGen for lambda conversion operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b49bd27b334a6c4e3bf9d810a7d5b022578f1194 16-Feb-2012 Dan Gohman <gohman@apple.com> Teach clang to add metadata tags to calls and invokes in ObjC with
-fno-objc-arc-exceptions. This will allow the optimizer to perform
optimizations which are only safe under that flag.

This is a part of rdar://10803830.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b74ed087469db042325bad76fdf3ff6ed67dec09 14-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Implement IRGen of lambda expressions which capture arrays.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
cec5ebd4a6a89a7023d04cec728fd340b541ed61 11-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Basic support for referring to captured variables from lambdas. Some simple examples seem to work. Tests coming up soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150293 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4c5d8afd100189b6cce4fd89bfb8aec5700acb50 09-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Refactor lambda IRGen so AggExprEmitter::VisitLambdaExpr does the right thing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
31a3702618ab49578542cffee20ba0c8859b9d1e 08-Feb-2012 Eli Friedman <eli.friedman@gmail.com> A little bit of lambda IRGen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4e1524babb095e70de1da882573eb6fbee98a857 29-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> revert r149184



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
de2fdc249e9c04757a7aaec029b231f4d7e6dbd7 28-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc-arc: Perform null check on receiver before sending methods which
consume one or more of their arguments. If not done, this will cause a leak
as method will not consume the argument when receiver is null.
// rdar://10444474


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
516bbd42e62d709013824d6fb8445a0cfda3129a 26-Jan-2012 Peter Collingbourne <peter@pcc.me.uk> Use function pointers, rather than references, to pass Destroyers
around, in the process cleaning up the various gcc/msvc compiler
workarounds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
170fd49294b85ab10f820721d99ff9d109c7230d 14-Jan-2012 Zhongxing Xu <xuzhongxing@foxmail.com> Remove a redundant word.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
20abee6b95c4f5a61e471b4b616439280ca4a81b 10-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc++: patch for IRgen for atomic properties of
c++ objects with non-trivial assignment/copy functions.
Also, one additional sema check. // rdar://6137845


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b6e5fe3cae9bf456f084c555c3ecc256f4181cc5 07-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc++: More codegen stuff for atomic properties of c++ objects
with non-trivial copies. // rdar://6137845



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
cd93b96bc51c255d104095bc6a6d8eac74a84b1e 06-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc++: more code gen stuff for atomic property api,
currently turned off. // rdar://6137845
Also, fixes a test case which should be nonatomic under
new API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
84e49865cbc2392787efcf2211ec53a947128a9e 06-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc++: sythesize a helper function to be used
for copying atomic properties of c++ objects
with non-trivial copy assignment in setters/getters.
Not yet used. // rdar://6137845


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
80d4b55db94db2172a04617d1a80feca6bbcea5c 28-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Small refactoring and simplification of constant evaluation and some of its
clients. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9631939f82c0eaa6fb3936a0ce58a41adfbc9011 12-Dec-2011 Tony Linthicum <tlinth@codeaurora.org> Hexagon backend support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bd7d82878c1588afccbee6c68fa6e17bbbab7f2c 05-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Make EmitAggregateCopy take an alignment argument. Make EmitFinalDestCopy pass in the correct alignment when known.

The test includes a FIXME for a related case involving calls; it's a bit more complicated to fix because the RValue class doesn't keep track of alignment.

<rdar://problem/10463337>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6da2c716017d5c8530ec99779524491ebc5dadb8 03-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Switch LValue so that it exposes alignment in CharUnits. (No functional change.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d7722d9d76a851e7897f4127626616d3b1b8e530 03-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Switch the Alignment argument on AggValueSlot over to CharUnits, per John's review comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f394078fde147dcf27e9b6a7965517388d64dcb6 03-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Track alignment in AggValueSlot. No functional change in this patch, but I'll be introducing uses of the specified alignment soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145736 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
86811609d9353e3aed198045d56e790eb3b6118c 27-Nov-2011 Peter Collingbourne <peter@pcc.me.uk> When destroying temporaries, instead of a custom cleanup use the
generic pushDestroy function.

This would reduce the number of useful declarations in
CGTemporaries.cpp to one. Since CodeGenFunction::EmitCXXTemporary
does not deserve its own file, move it to CGCleanup.cpp and delete
CGTemporaries.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2f77b3d57031ded0de2b7b977fb63b4660f82624 16-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix a bunch of really nasty bugs in how we compute alignment for reference lvalues. PR11376.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6f103ba42cb69d50005a977c5ea583984ab63fc4 10-Nov-2011 John McCall <rjmccall@apple.com> Whenever explicitly activating or deactivating a cleanup, we
need to provide a 'dominating IP' which is guaranteed to
dominate the (de)activation point but which cannot be avoided
along any execution path from the (de)activation point to
the push-point of the cleanup. Using the entry block is
bad mojo.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1a343ebbf413e8eae6b2737b2b2d79cbf5765571 10-Nov-2011 John McCall <rjmccall@apple.com> Enter the cleanups for a block outside the enclosing
full-expression. Naturally they're inactive before we enter
the block literal expression. This restores the intended
behavior that blocks belong to their enclosing scope.

There's a useful -O0 / compile-time optimization that we're
missing here with activating cleanups following straight-line
code from their inactive beginnings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a5493f885095bd63d525a7035ad1c224de3ae5f2 08-Nov-2011 John McCall <rjmccall@apple.com> Bind function "r-values" as l-values when emitting them as
opaque values. Silly C type system.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
db45806b991013280a03057025c9538de64d5dfb 07-Nov-2011 John McCall <rjmccall@apple.com> Rip the ObjCPropertyRef l-value kind out of IR-generation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4b9c2d235fb9449e249d74f48ecfec601650de93 06-Nov-2011 John McCall <rjmccall@apple.com> Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions. It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST. I've gone ahead and simplified the
ObjC rewriter's use of properties; other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily. Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c5096cbf7a42e0f9012945b00d9037a5b5a88d72 27-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Annotate imprecise FP division with fpaccuracy metadata

The OpenCL single precision division operation is only required to
be accurate to 2.5ulp. Annotate the fdiv instruction with metadata
which signals to the backend that an imprecise divide instruction
may be used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c3287793626a778178a4dbadcc7b64e392c6e26f 19-Oct-2011 Eric Christopher <echristo@apple.com> Add a new subclass of RunCleanupScopes that also handles creating new
lexical blocks for debug info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
276b061970939293f1abaf694bd3ef05b2cbda79 11-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Initial implementation of __atomic_* (everything except __atomic_is_lock_free).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6c0aa5ff6e6253db0f993053599e2a52b5b93b2d 06-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> CUDA: IR generation support for kernel call expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
348f16fc7c71f0d9b651cb79fd1012843073493f 04-Oct-2011 John McCall <rjmccall@apple.com> Mark calls to objc_retainBlock that don't result from casts
to id so that we can still optimize them appropriately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2b014d6c0c6b8ac94b416ac37dfc7931f20777a7 01-Oct-2011 John McCall <rjmccall@apple.com> When performing an @throw in ARC, retain + autorelease
the pointer, being sure to do so before running cleanups
associated with that full-expression. rdar://10042689



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
285cfd8953d4ca4da613a47a0d691f7234068f8c 19-Sep-2011 Bill Wendling <isanbard@gmail.com> Throw the switch to convert clang to the new exception handling model!

This model uses the 'landingpad' instruction, which is pinned to the top of the
landing pad. (A landing pad is defined as the destination of the unwind branch
of an invoke instruction.) All of the information needed to generate the correct
exception handling metadata during code generation is encoded into the
landingpad instruction.

The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic
call. It's lowered in much the same way as the intrinsic is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ae270598d5c7a9a283d4b3ddce53b151c6e2b182 15-Sep-2011 Bill Wendling <isanbard@gmail.com> Refactor the load of the exception pointer and the exception selector from their
storage slot into helper functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
197056726ed6412501130c2ef2ff69009772aa65 15-Sep-2011 John McCall <rjmccall@apple.com> Rewrite this loop to use partial destruction; I'm not sure it's
possible for that to matter right now, but eventually I think we'll
need to unify this better, and then it might. Also, use a more
efficient looping structure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1e1f4871535f2cadcbf8c9af8cc48a2213192320 13-Sep-2011 John McCall <rjmccall@apple.com> Unify the decision of how to emit property getters and setters into a
single code path. Use atomic loads and stores where necessary. Load and
store anything of the appropriate size and alignment with primitive
operations instead of going through the call.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
41bdde9e961c4d96a94148f20f0b18397f4358dd 13-Sep-2011 John McCall <rjmccall@apple.com> Privatize the setter/getter call generation methods, plus some minor
modernization. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
71c758d3f4ecc8b511e6ae4a7210486aa994c182 10-Sep-2011 John McCall <rjmccall@apple.com> Simplify the generation of Objective-C setters, at least a little.
Use a more portable heuristic for deciding when to emit a single
atomic store; it's possible that I've lost information here, but
I'm not sure how much of the logic before was intentionally arch-specific
and how much was just not quite consistent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
77f68bb90af93b95045fb994e7cd68137adcc132 10-Sep-2011 Julien Lerouge <jlerouge@apple.com> Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: can
annotate global, local variables, struct fields, or arbitrary statements (using
the __builtin_annotation), rdar://8037476.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
410ffb2bc5f072d58a73c14560345bcf77dec1cc 26-Aug-2011 John McCall <rjmccall@apple.com> Track whether an AggValueSlot is potentially aliased, and do not
emit call results into potentially aliased slots. This allows us
to properly mark indirect return slots as noalias, at the cost
of requiring an extra memcpy when assigning an aggregate call
result into a l-value. It also brings us into compliance with
the x86-64 ABI.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7c2349be2d11143a2e59a167fd43362a3bf4585e 25-Aug-2011 John McCall <rjmccall@apple.com> Use stronger typing for the flags on AggValueSlot and require
creators to tell us whether something needs GC barriers.
No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
777d6e56ad9b1fed9866daf3ee6486d85c5b7d32 11-Aug-2011 John McCall <rjmccall@apple.com> Simplify EH control flow by observing that EH scopes form a simple
hierarchy of delegation, and that EH selector values are meaningful
function-wide (good thing, too, or inlining wouldn't work).
2,3d
1a
hierarchy of delegation and that EH selector values have the same
meaning everywhere in the function instead of being meaningful only
in the context of a specific selector.

This removes the need for routing edges through EH cleanups,
since a cleanup simply always branches to its enclosing scope.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137293 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2d3ba4f5a923a90c3fc290ddfba5e36c2d0a9b46 23-Jul-2011 Chris Lattner <sabre@nondot.org> Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon Mulder!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8cc488fefb2fb04bc8d5398da29f0182f97934cf 20-Jul-2011 Chris Lattner <sabre@nondot.org> add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
686775deca8b8685eb90801495880e3abdd844c2 20-Jul-2011 Chris Lattner <sabre@nondot.org> now that we have a centralized place to do so, add some using declarations for
some common llvm types: stringref and smallvector. This cleans up the codebase
quite a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
4c7d9f1507d0f102bd4133bba63348636facd469 15-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert CallInst and InvokeInst APIs to use ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
fbf780a9d1dbb191fc40c8af967c590e08724b74 13-Jul-2011 John McCall <rjmccall@apple.com> Okay, that rule about zero-length arrays applies to destroying
them, too.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8f62992730c88e3b9d6815c322e045e79251d3d5 13-Jul-2011 John McCall <rjmccall@apple.com> Aggressive dead code elimination.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a91f6661c4685fecee6dc09bdaef73254c1aaa06 13-Jul-2011 John McCall <rjmccall@apple.com> Generalize the routine for destroying an object with static
storage duration, then explicitly exempt ownership-qualified
types from it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ad346f4f678ab1c3222425641d851dc63e9dfa1a 12-Jul-2011 John McCall <rjmccall@apple.com> Generalize Cleanup::Emit's "isForEH" parameter into a set
of flags. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9928c4805aa8d5fabd488d0d0c5aeb64fd50f0e3 12-Jul-2011 John McCall <rjmccall@apple.com> Switch field destruction over to use the new destroyer-based API
and kill a lot of redundant code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134988 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
811bf3669f4d82c57fe3cd3c49050fdbc95d0aff 12-Jul-2011 Chris Lattner <sabre@nondot.org> insert a bitcast in the 'expand' case of argument passing when needed. This
fixes the -m32 build of oggenc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c4a1a8450a3613ef256a71b9d8305b41f79eef50 12-Jul-2011 John McCall <rjmccall@apple.com> Do full-expression cleanups in a much more sensible way that still lets
people write useful cleanup classes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2673c68aa58e277ebc755b71d81aca618cdedbf9 11-Jul-2011 John McCall <rjmccall@apple.com> Fix a lot of problems with the partial destruction of arrays:
- an off-by-one error in emission of irregular array limits for
InitListExprs
- use an EH partial-destruction cleanup within the normal
array-destruction cleanup
- get the branch destinations right for the empty check
Also some refactoring which unfortunately obscures these changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9cbe4f0ba01ec304e1e3d071c071f7bca33631c0 09-Jul-2011 Chris Lattner <sabre@nondot.org> clang side to match the LLVM IR type system rewrite patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bdc4d80956c83a486e58d3df6bb524a1f66ff574 09-Jul-2011 John McCall <rjmccall@apple.com> A number of array-related IR-gen cleanups.
- Emit default-initialization of arrays that were partially initialized
with initializer lists with a loop, rather than emitting the default
initializer N times;
- support destroying VLAs of non-trivial type, although this is not
yet exposed to users; and
- support the partial destruction of arrays initialized with
initializer lists when an initializer throws an exception.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
545d996ec5a3113f046944f11b27cc2d6cb055b4 25-Jun-2011 John McCall <rjmccall@apple.com> LValue carries a type now, so simplify the main EmitLoad/Store APIs
by removing the redundant type parameter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0c24c808e4dce43e88abf2d5f98546b901bd4315 25-Jun-2011 John McCall <rjmccall@apple.com> Honor objc_precise_lifetime in GC mode by feeding the value
in the variable to an inline asm which gets run when the variable
goes out of scope.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bc8d40d85f3fa1e34569834916f18fecaa635152 24-Jun-2011 John McCall <rjmccall@apple.com> Change the IR-generation of VLAs so that we capture bounds,
not sizes; so that we use well-typed allocas; and so that we
properly recurse through the full set of variably-modified types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d7b23167763f43d3e76b0de26141b1e52613ee3c 22-Jun-2011 Douglas Gregor <dgregor@apple.com> When binding a reference to an Automatic Reference Counting temporary,
retain/release the temporary object appropriately. Previously, we
would only perform the retain/release operations when the reference
would extend the lifetime of the temporary, but this does the wrong
thing across calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d768e9d29abe1ac1ccc3ed63f2dce835d9bab342 22-Jun-2011 John McCall <rjmccall@apple.com> Emit @finally blocks completely lazily instead of forcing their
existence by always threading an edge from the catchall. Not doing
this was previously causing a crash in the very extreme case where
neither the normal cleanup nor the EH catchall was actually reachable:
we would delete the catchall entry block, which would cause us to
delete the entry block of the finally cleanup as well because the
cleanup logic would merge the blocks, which in turn triggered an assert
because later blocks in the finally would still be using values from the
entry. Laziness turns out to be the most elegant solution to the problem.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
7acddacc921cd0b3f813443a8641eeddb82dfbd4 17-Jun-2011 John McCall <rjmccall@apple.com> Objective-C fast enumeration loop variables are not retained in ARC, but
they should still be officially __strong for the purposes of errors,
block capture, etc. Make a new bit on variables, isARCPseudoStrong(),
and set this for 'self' and these enumeration-loop variables. Change
the code that was looking for the old patterns to look for this bit,
and change IR generation to find this bit and treat the resulting
variable as __unsafe_unretained for the purposes of init/destroy in
the two places it can come up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a07398ed98ea2b55ad7a505a3aab18aed93b149f 16-Jun-2011 John McCall <rjmccall@apple.com> Restore correct use of GC barriers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
93c332a8ba2c193c435b293966d343dab15f555b 28-May-2011 John McCall <rjmccall@apple.com> Convert Clang over to resuming from landing pads with llvm.eh.resume.
It's quite likely that this will explode, but I need to know how. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
addd80d1c80d1e9f249988452103c93a564945f0 27-May-2011 Eli Friedman <eli.friedman@gmail.com> Back out r132209; it's breaking nightly tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0903421e36c174a82597f83bd296f3cd5b5f169b 27-May-2011 John McCall <rjmccall@apple.com> Implement a new, much improved version of the cleanup hack. We just need
to be careful to emit landing pads that are always prepared to handle a
cleanup path. This is correct mostly because of the fix to the LLVM
inliner, r132200.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8d3f8979e46f9d0b8735566eabe471db0e1e0e53 20-May-2011 Devang Patel <dpatel@apple.com> Fix location of setter/getter synthesized for a property.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f2aac84709c418189e476ad591848dad50291885 15-May-2011 John McCall <rjmccall@apple.com> Make CGF.getContext() inlinable, because it's trivial, and optimize
hasAggregateLLVMType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a2447e0d1e28669cd637204a871f15b1215277fd 08-May-2011 Anders Carlsson <andersca@mac.com> Move code to emit the callee of an CXXOperatorCallExpr out into a separate function in CGClass.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7dcdf5ba9324a9577461eae302e88fdd52e310c5 06-May-2011 Eli Friedman <eli.friedman@gmail.com> Add an implementation of thunks for varargs methods. The implementation is a bit messy, but it is correct as long as the method in question doesn't use indirect gotos. A couple of possible alternative implementations are outlined in FIXME's in this patch. rdar://problem/8077308 .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
059ce0d92eb5a7da900ae735dc0a2ea3d64f4b0b 01-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Fully implement delegating constructors!

As far as I know, this implementation is complete but might be missing a
few optimizations. Exceptions and virtual bases are handled correctly.

Because I'm an optimist, the web page has appropriately been updated. If
I'm wrong, feel free to downgrade its support categories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b11f9198111796ada02b57f62cdea92134fde9f7 17-Apr-2011 Chris Lattner <sabre@nondot.org> implement rdar://9289524 - case followed immediately by break results in empty IR block,
a -O0 code quality issue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
fc8f0e14ad142ed811e90fbd9a30e419e301c717 15-Apr-2011 Chris Lattner <sabre@nondot.org> fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ad762fcdc16b9e4705b12b09d92b8c026212b906 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f0c11f7e6848f023ced6a5b51399ba787c7d4d0b 31-Mar-2011 John McCall <rjmccall@apple.com> After much contemplation, I've decided that we probably shouldn't "unique"
__block object copy/dispose helpers for C++ objects with those for
different variables with completely different semantics simply because
they happen to both be no more aligned than a pointer.

Found by inspection.

Also, internalize most of the helper generation logic within CGBlocks.cpp,
and refactor it to fit my peculiar aesthetic sense.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5af02db5a48476e0748f135369663080eae87c64 31-Mar-2011 John McCall <rjmccall@apple.com> Move all the significant __block code into CGBlocks.cpp. No functionality
change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d6fb21fa1053e5d616af55b181bb03c50d4b0d24 23-Mar-2011 Ken Dyck <kd@kendyck.com> Convert OffsetFromNearestVBast parameter of InitializeVTablePointer(s) to
CharUnits. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
413ebdb1af6fb0d81845b61254daf02ba0449afd 11-Mar-2011 John McCall <rjmccall@apple.com> Use a slightly more semantic interface for emitting call arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d26bc76c98006609002d9930f8840490e88ac5b5 09-Mar-2011 John McCall <rjmccall@apple.com> Use the "undergoes default argument promotion" bit on parameters to
simplify the logic of initializing function parameters so that we don't need
both a variable declaration and a type in FunctionArgList. This also means
that we need to propagate the CGFunctionInfo down in a lot of places rather
than recalculating it from the FAL. There's more we can do to eliminate
redundancy here, and I've left FIXMEs behind to do it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
60d3365b46eb826fba44483583c0051ac5c41fe3 08-Mar-2011 John McCall <rjmccall@apple.com> Extract a function to emit an arbitrary expression as if it were the initializer
for a local variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
aa11289f754d220c9c155b68a4f84cdcfcefef6a 07-Mar-2011 Devang Patel <dpatel@apple.com> DebugInfo can be enabled or disabled at function level (e.g. using an attribute). However, at module level it is determined by command line option and the state of command line option does not change during compilation. Make this layering explicit and fix accidental cases where the code generator was checking whether module has debug info enabled instead of checking whether debug info is enabled for this function or not.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
093ac461b37a573dcf226fa55faed96f318169b9 03-Mar-2011 Devang Patel <dpatel@apple.com> Encode argument numbering in debug info so that code generator can emit them in order.
This fixes few blocks.exp regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9c6082fe89c61af697f017aa80937581cc2128d8 02-Mar-2011 Tilmann Scheller <tilmann.scheller@googlemail.com> Revert "Add CC_Win64ThisCall and set it in the necessary places."

This reverts commit 126863.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
41ba26701de859128ebe48a957c286e5dc01475f 02-Mar-2011 Devang Patel <dpatel@apple.com> revert r126858.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
88d117c2eedd7c5bec57ac983a98d5e12bdd2cc6 02-Mar-2011 Tilmann Scheller <tilmann.scheller@googlemail.com> Add CC_Win64ThisCall and set it in the necessary places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
810b07ccf7b19f532402d24064df543bb0518acd 02-Mar-2011 Devang Patel <dpatel@apple.com> Encode argument numbering in debug info so that code generator can emit them in order.
This fixes few blocks.exp regressions.

Reapply r126795 with a fix (one character change) for gdb testsuite regressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3da5cb2d6e582ab3acb5dd0d2fd8ab31922750be 02-Mar-2011 Devang Patel <dpatel@apple.com> Revert r126794.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8a04585eba8a87a660c9030c9cdef34c8c9f85c6 01-Mar-2011 Devang Patel <dpatel@apple.com> Encode argument numbering in debug info so that code generator can emit them in order.
This fixes few blocks.exp regressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ef425a69006afaa87751ee41ccf8ff405d9ede70 28-Feb-2011 Chris Lattner <sabre@nondot.org> Add some helper methods that will be used in my next patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c2c90011a688c04a4e980282f08c267e081c4b00 28-Feb-2011 Chris Lattner <sabre@nondot.org> Change the interface to ConstantFoldsToSimpleInteger to not encode
a bool + success into one tri-state integer, simplifying things.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
57b3b6a60856eaec30fd876a8a3face8f7e3ad7b 22-Feb-2011 John McCall <rjmccall@apple.com> Establish the iteration variable of an ObjC for-in loop before
emitting the collection expression. Fixes some really, really broken
code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
34695856c0e67b3765b46304cc71b5d2cd5b71c7 22-Feb-2011 John McCall <rjmccall@apple.com> Reorganize the emission of local variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c1cfdf8647a499b6b3024f4bd14a236cddb23988 20-Feb-2011 Anders Carlsson <andersca@mac.com> Add a LangOptions::areExceptionsEnabled and start using it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2846b97965e980ad2e7c8d444b82cc21d733a699 18-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Objective-c armv7 API for atomic properties of
scalar types. // rdar://7761305


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
cf0b2d83666804b377dbe05370a5c9b9bafaaa5a 17-Feb-2011 John McCall <rjmccall@apple.com> Remove the "conditional save" hashtables from IR generation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125761 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
56ca35d396d8692c384c785f9aeebcf22563fe1e 17-Feb-2011 John McCall <rjmccall@apple.com> Change the representation of GNU ?: expressions to use a different expression
class and to bind the shared value using OpaqueValueExpr. This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait; or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.

Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.

This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here. In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.

I've tried to update the analyzer to deal with this in at least some
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ad8dcf4a9df0e24051dc31bf9e6f3cd138a34298 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt. There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself. This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.

This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.

This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.

Review appreciated, particularly for the cindex and template bits.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e996ffd240f20a1048179d7727a6ee3227261921 16-Feb-2011 John McCall <rjmccall@apple.com> Save a copy expression for non-trivial copy constructions of catch variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
34753802931fddcf57bd62c5b83bdca1a23017d7 16-Feb-2011 Devang Patel <dpatel@apple.com> Simplify test to check an aggregate argument that has non trivial constructor or destructor.
This patch rewrites r125142.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5936e33bf74dd6bf126ceee0f6169a2593d03a69 15-Feb-2011 John McCall <rjmccall@apple.com> Assorted cleanup:
- Have CGM precompute a number of commonly-used types
- Have CGF copy that during initialization instead of recomputing them
- Use TBAA info when initializing a parameter variable
- Refactor the scalar ++/-- code



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
be4c8705e499b55548467eb7adaa23cbc6edfef9 10-Feb-2011 Roman Divacky <rdivacky@freebsd.org> Implement mcount profiling, enabled via -pg.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
570729e71654f0564bf2ce6504f8629a96850914 09-Feb-2011 Devang Patel <dpatel@apple.com> If an aggregate argument is passed indirectly because it has non trivial
destructor or copy constructor than let debug info know about it.

Radar 8945514.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d16c2cf1cafa413709aa487cbbd5dc392f1ba1ff 08-Feb-2011 John McCall <rjmccall@apple.com> Reorganize CodeGen{Function,Module} to eliminate the unfortunate
Block{Function,Module} base class. Minor other refactorings.

Fixed a few address-space bugs while I was there.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6b5a61b6dc400027fd793dcadceeb9da944a37ea 07-Feb-2011 John McCall <rjmccall@apple.com> A few more tweaks to the blocks AST representation:
- BlockDeclRefExprs always store VarDecls
- BDREs no longer store copy expressions
- BlockDecls now store a list of captured variables, information about
how they're captured, and a copy expression if necessary

With that in hand, change IR generation to use the captures data in
blocks instead of walking the block independently.

Additionally, optimize block layout by emitting fields in descending
alignment order, with a heuristic for filling in words when alignment
of the end of the block header is insufficient for the most aligned
field.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
771c678c04f5f685b4f188ec6c2fd88ad0f7457f 03-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Clean up of -fapple-kext abi code. No change otherwise.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ccd5259d33cbbdd6f5fbf7ccab4cb4a2702309ea 02-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> -fapple-kext support for indirect call to virtuals dtors - wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
804b807ea918184d6de63bd745e1ff75a9bfc679 28-Jan-2011 John McCall <rjmccall@apple.com> Reorganize the value-dominance metaprogram and introduce a specialization
for CodeGen's RValue type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3ad32c8d93eb65d1d4943d7df567fc9b4f55d137 28-Jan-2011 John McCall <rjmccall@apple.com> Convert the exception-freeing cleanup over to the conditional cleanups code,
fixing a crash which probably nobody was ever going to see. In doing so,
fix a horrendous number of problems with the conditional-cleanups code.
Also, make conditional cleanups re-use the cleanup's activation variable,
which avoids some unfortunate repetitiveness.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
52a80e19ad688091723a52ad53337767bb0ac684 27-Jan-2011 Fariborz Jahanian <fjahanian@apple.com> Fixes an IRgen bug where __block variable is
referenced in the block-literal initializer
of that variable. // rdar://8893785


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124332 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4bbcbda302cba8b1b0d88c20d735d09b483bd005 26-Jan-2011 John McCall <rjmccall@apple.com> Fix some obvious bugs in the conditional-cleanup code and then make the
dtor cleanup use it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
150b462afc7a713edd19bcbbbb22381fe060d4f5 26-Jan-2011 John McCall <rjmccall@apple.com> Better framework for conditional cleanups; untested as yet.
I'm separately committing this because it incidentally changes some
block orderings and minor IR issues, like using a phi instead of
an unnecessary alloca.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2726267f094a0c1f5ac5b501ec5a9898c58876bf 20-Jan-2011 Fariborz Jahanian <fjahanian@apple.com> apple kext abi requires all vf calls, including qualified
vf calls, be made indirect. This patch is towards that goal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
14110477887e3dc168ffc6c191e72d705051f99e 13-Jan-2011 Peter Collingbourne <peter@pcc.me.uk> Move name mangling support from CodeGen to AST. In the
process, perform a number of refactorings:

- Move MiscNameMangler member functions to MangleContext
- Remove GlobalDecl dependency from MangleContext
- Make MangleContext abstract and move Itanium/Microsoft functionality
to their own classes/files
- Implement ASTContext::createMangleContext and have CodeGen use it

No (intended) functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
db3d4d036037f379f12643e067b229862d61e932 08-Dec-2010 Bob Wilson <bob.wilson@apple.com> Stop using builtins for the "_lane" variants of saturating multiply intrinsics.
Remove the "splat" parameter from the EmitNeonCall function, since it is no
longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
cf55652cf668c1402eee0b12edd2e5a1bc34d7a1 07-Dec-2010 Bob Wilson <bob.wilson@apple.com> Stop using a clang builtin for Neon vdup_lane intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4765fa05b5652fcc4356371c2f481d0ea9a1b007 06-Dec-2010 John McCall <rjmccall@apple.com> Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2a41637a995affa1563f4d82a8b026e326a2faa0 05-Dec-2010 John McCall <rjmccall@apple.com> Fix a bug in the emission of __real/__imag l-values on scalar operands.
Fix a bug in the emission of complex compound assignment l-values.
Introduce a method to emit an expression whose value isn't relevant.
Make that method evaluate its operand as an l-value if it is one.
Fixes our volatile compliance in C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
00eb3f9c5b33e3d99aee1f8b75dd9c9678fdd66b 04-Dec-2010 Francois Pichet <pichet2000@gmail.com> More anonymous struct/union redesign. This one deals with anonymous field used in a constructor initializer list:

struct X {
X() : au_i1(123) {}
union {
int au_i1;
float au_f1;
};
};

clang will now deal with au_i1 explicitly as an IndirectFieldDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e68b9842d2d6adc2c72c81c845a2c68e58d9d3a4 04-Dec-2010 John McCall <rjmccall@apple.com> Test case for the l-value base only being evaluated once.

Also, move the l-value emission code into CGObjC.cpp and teach it, for
completeness, to store away self for a super send.

Also, inline the super cases for property gets and sets and make them
use the correct result type for implicit getter/setter calls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
119a1c6c4029d30cae7b31a2826aa0ff70d01668 04-Dec-2010 John McCall <rjmccall@apple.com> Kill the KVC l-value kind and calculate the base expression when emitting
the l-value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
830937bc1100fba7682f7c32c40512085870f50c 02-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> IR Gen. part of API support for __block cxx
objects imported into blocks. //rdar://8594790.
Will have a test case coming (as well as one
sent to llvm test suite).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1b726771d00762fb5c4c2638e60d134c385493ae 02-Dec-2010 Chris Lattner <sabre@nondot.org> Improve codegen for initializer lists to use memset more aggressively
when an initializer is variable (I handled the constant case in a previous
patch). This has three pieces:

1. Enhance AggValueSlot to have a 'isZeroed' bit to tell CGExprAgg that
the memory being stored into has previously been memset to zero.
2. Teach CGExprAgg to not emit stores of zero to isZeroed memory.
3. Teach CodeGenFunction::EmitAggExpr to scan initializers to determine
whether they are profitable to emit a memset + inividual stores vs
stores for everything.

The heuristic used is that a global has to be more than 16 bytes and
has to be 3/4 zero to be candidate for this xform. The two testcases
are illustrative of the scenarios this catches. We now codegen test9 into:

call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 400, i32 4, i1 false)
%.array = getelementptr inbounds [100 x i32]* %Arr, i32 0, i32 0
%tmp = load i32* %X.addr, align 4
store i32 %tmp, i32* %.array

and test10 into:

call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 392, i32 8, i1 false)
%tmp = getelementptr inbounds %struct.b* %S, i32 0, i32 0
%tmp1 = getelementptr inbounds %struct.a* %tmp, i32 0, i32 0
%tmp2 = load i32* %X.addr, align 4
store i32 %tmp2, i32* %tmp1, align 4
%tmp5 = getelementptr inbounds %struct.b* %S, i32 0, i32 3
%tmp10 = getelementptr inbounds %struct.a* %tmp5, i32 0, i32 4
%tmp11 = load i32* %X.addr, align 4
store i32 %tmp11, i32* %tmp10, align 4

Previously we produced 99 stores of zero for test9 and also tons for test10.
This xforms should substantially speed up -O0 builds when it kicks in as well
as reducing code size and optimizer heartburn on insane cases. This resolves
PR279.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
12f78a6741a4cb3d904340f8d3d2714568b50e7a 02-Dec-2010 John McCall <rjmccall@apple.com> Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
into the latter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
83eedd9fa800c273647c7a90465ea9c110f9d93c 28-Nov-2010 Anders Carlsson <andersca@mac.com> BuildVirtualCall doesn't need to take a reference to a pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
83ce9d4a552987d34cbd500e983db8d770232379 17-Nov-2010 John McCall <rjmccall@apple.com> Support compound complex operations as l-values in C++. Add a test
case based on CodeGen/volatile-1.c which tests the current C++
semantics, and note the many, many places we fall short of them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e220455a059d926953befe72857b9525273717ef 16-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Implements __block API for c++ objects. There is still
issue with runtime which I am discussing it with Blaine.
This is wip (so no test yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b418d74c11498b7e1044103131e2e3be4d63512e 16-Nov-2010 John McCall <rjmccall@apple.com> Simplify some complex emission and implement correct semantics for
assignment to volatiles in C. This in effect reverts some of mjs's
work in and around r72572. Basically, the C++ standard is quite
clear, except that it lies about volatile behavior approximating
C's, whereas the C standard is almost actively misleading.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
34999876e215b22febc240b1a6dc054215d12f9c 13-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Block API patch to do copy ctor of copied-in cxx objects in
copy helper function and dtor of copied cxx objects
in dispose helper functions. __block variables
TBD next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3030eb82593097502469a8b3fc26112c79c75605 06-Nov-2010 John McCall <rjmccall@apple.com> Simplify the logic for emitting guard variables for template static
data members by delaying the emission of the initializer until after
linkage and visibility have been set on the global. Also, don't
emit a guard unless the variable actually ends up with vague linkage,
and don't use thread-safe statics in any case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
26815d97c5743481e317f17a8d53a6819d061862 27-Oct-2010 John McCall <rjmccall@apple.com> Restore r117403 (fixing IR gen for bool atomics), this time being less
aggressive about the form we expect bools to be in. I don't really have
time to fix all the sources right now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
11893327d056a7ebd820da8f00a3286e7430a91c 27-Oct-2010 Rafael Espindola <rafael.espindola@gmail.com> Revert r117403 as it caused PR8480.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117456 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
789a1597250e57d7f35f253467165913c68979ad 27-Oct-2010 John McCall <rjmccall@apple.com> Extract procedures to do scalar-to-memory and memory-to-scalar conversions
in IR gen, and use those to fix a correctness issue with bool atomic
intrinsics. rdar://problem/8461234



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117403 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
043fb9a1fc0609285f60f0f87e5a18195408f34c 26-Oct-2010 Dan Gohman <gohman@apple.com> Factor out the code for emitting code to load vtable pointer members
so that it's done in one place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9cac4942b920d4c5514e71949e3062ed626bfbdf 19-Oct-2010 Michael J. Spencer <bigcheesegs@gmail.com> Fix Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
3d5aff5d3036b0ff09d114857cd2276134b3d8c9 15-Oct-2010 Dan Gohman <gohman@apple.com> Experimental TBAA support.

This enables metadata generation by default, however the TBAA pass
in the optimizer is still disabled for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8ac2d449820fd0df00fcbde5bf82165c1f49854d 14-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
aa51e513850688b7963efc62abf1eface7037602 09-Oct-2010 Bill Wendling <isanbard@gmail.com> Add target implementations for the X86 builtins:

__builtin_ia32_vec_init_v8qi
__builtin_ia32_vec_init_v4hi
__builtin_ia32_vec_init_v2si

They are lowered to bitcasts. (These are all ready tested by the gcc testsuite.)
<rdar://problem/8529957>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
189d6ef40eff11b83b2cda941d5ed89a5cef09b2 09-Oct-2010 John McCall <rjmccall@apple.com> Permit constant evaluation of const floating-point variables with
constant initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
28cab383fd9e7647d2186340eca769303cc4fbdb 28-Sep-2010 Bill Wendling <isanbard@gmail.com> Accidentally committed some temporary changes on my branch when reverting patches.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2a674e8e443b7a3e77957078248fb52b3b1ec321 28-Sep-2010 Bill Wendling <isanbard@gmail.com> Temporarily revert 114929 114925 114924 114921. It looked like they (or at least
one of them) was causing a series of failures:

http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518

svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U include/clang/Sema/Sema.h
U include/clang/AST/DeclCXX.h
U lib/Sema/SemaDeclCXX.cpp
U lib/Sema/SemaTemplateInstantiateDecl.cpp
U lib/Sema/SemaDecl.cpp
U lib/Sema/SemaTemplateInstantiate.cpp
U lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp
U lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
745da3a5bb4ea35f93f50301e7fbbb7d78d3b6bb 24-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Patch implements passing arrays to functions expecting
vla. Implements pr7827.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0b78710636671eeb2c5c4dedffa4ad1d58fa4bb8 21-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> IRgen for gnu extension's conditional lvalue expression
with missing LHS. radar 8453812. Executable test is checked
into llvm test suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
aa3b57ee9e36a805371e2a543383225cdd2a5d83 21-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Implements in IRgen gnu extensions missing LHS for
complex conditionals. Radar 8453812.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8abdbd8118e37e759d1ce3f5814ee0a24b1589e8 18-Sep-2010 John McCall <rjmccall@apple.com> Adjust a fixup's starting branch if it's being resolved because
it reached the outermost scope and it hasn't yet been forwarded
to a cleanup. Fixed PR8175.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
af9b96828f9126d993c3e155b8453be62013b735 17-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to add IRgen support for Gnu's conditional operator
extension when missing LHS. This patch covers scalar
conditionals only. Others are wip.
(pr7726, radar 8353567).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3019c444c672938c57f5573840071ecd73425ee7 17-Sep-2010 John McCall <rjmccall@apple.com> When emitting a new-expression inside a conditional expression,
the cleanup might not be dominated by the allocation code.
In this case, we have to store aside all the delete arguments
in case we need them later. There's room for optimization here
in cases where we end up not actually needing the cleanup in
different branches (or being able to pop it after the
initialization code).

Also make sure we only call this operator delete along the path
where we actually allocated something.

Fixes rdar://problem/8439196.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
474e2fe4957e6e72cee36ed189eaf21878ad0e91 16-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to move RequiresGCollection bit to
AggValueSlot slot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
558d2abc7f9fd6801cc7677200992313ae90b5d8 15-Sep-2010 John McCall <rjmccall@apple.com> one piece of code is responsible for the lifetime of every aggregate
slot. The easiest way to do that was to bundle up the information
we care about for aggregate slots into a new structure which demands
that its creators at least consider the question.

I could probably be convinced that the ObjC 'needs GC' bit should
be rolled into this structure.
Implement generalized copy elision. The main obstacle here is that
IR-generation must be much more careful about making sure that exactly



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7d8647f194ae4f2499e5bcd40dcfea34cd21ebc6 14-Sep-2010 John McCall <rjmccall@apple.com> Implement the EH cleanup to call 'operator delete' if a new-expression throws
(but not if destructors associated with the full-expression throw).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4ada2ca7d82dab68d3646f3eb6dcdfee072e8ea4 14-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix VLA miscompilation.

llvm.stacksave/llvm.stackrestore wasn't emitted for VLAs in inner scopes.
Fixes r8403108.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5cd91b513455fd7753e8815b54f0a49bbca6602d 08-Sep-2010 John McCall <rjmccall@apple.com> Implement ARM static local initialization guards, which are more compact than
Itanium guards and use a slightly different compiled-in API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1e7fe751466ea82665fd21e9162fd7cc9c5f412d 02-Sep-2010 John McCall <rjmccall@apple.com> Abstract IR generation of array cookies into the C++ ABI class and
implement ARM array cookies. Also fix a few unfortunate bugs:
- throwing dtors in deletes prevented the allocation from being deleted
- adding the cookie to the new[] size was not being considered for
overflow (and, more seriously, was screwing up the earlier checks)
- deleting an array via a pointer to array of class type was not
causing any destructors to be run and was passing the unadjusted
pointer to the deallocator
- lots of address-space problems, in case anyone wants to support
free store in a variant address space :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
983e3d7dac99aed376939f1a4daadef98e09c3b9 21-Aug-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Set the alignment correctly when creating LValue for a decls.
- Fixes PR5598.
- Review appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f2c737c5b89e5ba3e2a64595930ab894df206bd2 21-Aug-2010 Daniel Dunbar <daniel@zuster.org> CodeGenFunction: Eliminate unused MakeQualifiers() function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f1fbda380b200923ea6275c61cd22cc99d4d75c0 21-Aug-2010 Daniel Dunbar <daniel@zuster.org> IRgen/CGValue: Give MakeAddrLValue() an alignment argument, and eliminate old form of MakeAddr().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
5cf8bfec711116b3c4acc70a00717b2e119e7550 21-Aug-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Add an LValue::MakeAddr variant which takes a type and uses that to build
the qualifiers.

Also, add CodeGenFunction::MakeAddrLValue() helper function which passes in the
ASTContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
91a16fa3265686b90054715eea504d9b4a13438b 21-Aug-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument and
update callers as best I can.
- This is a work in progress, our alignment handling is very horrible / sketchy -- I am just aiming for monotonic improvement.
- Serious review appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
838d796d020f6a8cd2b2d1e2a0a85c83bbf29543 14-Aug-2010 John McCall <rjmccall@apple.com> More cleanup enabling.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
cd2d2b7814e0104ed41a8da159a06a8ca77b70d8 13-Aug-2010 John McCall <rjmccall@apple.com> Sketch out a framework for delaying the activation of a cleanup.
Not yet complete or used.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
25c2c8fb9309050612009a6571e2660e75531348 10-Aug-2010 Devang Patel <dpatel@apple.com> Simplify code and add comments, in code that generate debug info for constant integer globals, based on Chris's feedback.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8d308384a220c7dc81755c47cdcbdd87dac25d5b 10-Aug-2010 Devang Patel <dpatel@apple.com> Even if a constant's evaluated value is used, emit debug info for the constant variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
cd480ad90ff4c144084805761d2dfa52ee9e1c92 06-Aug-2010 Nate Begeman <natebegeman@mac.com> vdup_lane was missing
<rdar://problem/8278732>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
44034db24bf59a53aa7699f4bbf59b939710bb3c 04-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> More objc block variable layout info. work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
89ecd41e0a6bfb3b0913dbe41c3c666340b308c7 04-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Some early work for providing block layout info.
for objective-c/c++ blocks (NeXt runtime).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
413e67778d593215d2f2161a4e712c8568f1ddd0 28-Jul-2010 John McCall <rjmccall@apple.com> When creating a jump destination, its scope should be the scope of the
enclosing normal cleanup, not the top of the EH stack. I'm *really*
surprised this hasn't been causing more problems.

Fixes rdar://problem/8231514.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ff8e11579fc904aa4032d90d2be6ce1ac5fc9fe1 23-Jul-2010 John McCall <rjmccall@apple.com> Revise cleanup IR generation to fix a major bug with cleanups (PR7686)
as well as some significant asymptotic inefficiencies with threading
multiple jumps through deep cleanups.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1f0fca54676cfa8616e7f3cd7a26788ab937e3cd 21-Jul-2010 John McCall <rjmccall@apple.com> Rename LazyCleanup -> Cleanup. No functionality change for these last three
commits.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7495f22934d577c71b4b5bae82142ad54ccb1d59 21-Jul-2010 John McCall <rjmccall@apple.com> Rip out EHCleanupScope.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6962f8d156735172146ae812732f4c4ddc13e91b 21-Jul-2010 John McCall <rjmccall@apple.com> Kill the CleanupBlock API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
81407d404a3fc8d24d0e2a052d85cae183033e2b 21-Jul-2010 John McCall <rjmccall@apple.com> Switch the destructor for a temporary arising from a reference binding over to
using a lazy cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
77199713ab56f87ffad9a535ff2a0877704eed87 21-Jul-2010 John McCall <rjmccall@apple.com> Switch finally cleanups over to being lazy cleanups. We get basically nothing
from the laziness features here except better block ordering, but it removes yet
another CleanupBlock use.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
50da2cadcc6da86abff6772de65280ace2cabc94 21-Jul-2010 John McCall <rjmccall@apple.com> Implement proper base/member destructor EH chaining.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
59174c0633fb5cde41735cfbff5744bdf837e8d9 21-Jul-2010 Douglas Gregor <dgregor@apple.com> Implement zero-initialization for array new when there is an
initializer of (). Make sure to use a simple memset() when we can, or
fall back to generating a loop when a simple memset will not
suffice. Fixes <rdar://problem/8212208>, a regression due to my work
in r107857.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1bda662cb37d9fe24be4b3cf8ea0f4e550e1f889 21-Jul-2010 John McCall <rjmccall@apple.com> Add a little helper method which will be useful soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
83252dcfe61aaebcb6bc117e71dc12968729513f 20-Jul-2010 Chris Lattner <sabre@nondot.org> Follow the implementation approach suggested by PR6687,
which generates more efficient and more obviously conformant
code. We now test for overflow of the multiply then force
the result to -1 if so. On X86, this generates nice code
like this:

__Z4testl: ## @_Z4testl
## BB#0: ## %entry
subl $12, %esp
movl $4, %eax
mull 16(%esp)
testl %edx, %edx
movl $-1, %ecx
cmovel %eax, %ecx
movl %ecx, (%esp)
call __Znam
addl $12, %esp
ret



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6c552c1d5f47fbba00e6268d96a26ad026f2da2a 20-Jul-2010 Chris Lattner <sabre@nondot.org> implement rdar://5739832 - operator new should check for overflow in multiply,
causing clang to compile this code into something that correctly throws a
length error, fixing a potential integer overflow security attack:

void *test(long N) {
return new int[N];
}

int main() {
test(1L << 62);
}

We do this even when exceptions are disabled, because it is better for the
code to abort than for the attack to succeed.

This is heavily based on a patch that Fariborz wrote.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6d7cfd7ef82e42ff30ee1dafd2883fd94e9f8294 16-Jul-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR3800: make sure not to evaluate the expression for a read-write
asm operand twice.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3e29f96988b0438e42dba3790f61fb3df42d90cb 14-Jul-2010 John McCall <rjmccall@apple.com> Work around an obnoxious GCC warning by changing semantics in a hopefully-
harmless way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108295 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8e3f86193995c47ee0d229e4336c3382410f09f5 14-Jul-2010 John McCall <rjmccall@apple.com> Allow for the possibility that __cxa_end_catch might throw for a catch-all block
or a catch of a record type by value or reference. Also convert this to a
lazy cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
da65ea86482bc116906edfb9ba1d7124f76cc867 13-Jul-2010 John McCall <rjmccall@apple.com> Teach IR generation how to lazily emit cleanups. This has a lot of advantages,
mostly in avoiding unnecessary work at compile time but also in producing more
sensible block orderings.

Move the destructor cleanups for local variables over to use lazy cleanups.
Eventually all cleanups will do this; for now we have some awkward code
duplication.

Tell IR generation just to never produce landing pads in -fno-exceptions.
This is a much more comprehensive solution to a problem which previously was
half-solved by checks in most cleanup-generation spots.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ed8abf18329df67b0abcbb3a10458bd8c1d2a595 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
84745677f64863e025a6733cb29d0b94bc3a6ae2 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
016a4a90c8e75d59de731fa3aa98f0a55656e66c 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect its
newly-narrowed scope. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
59a7000a79118e4c140885ccbb2ac6a686a73092 07-Jul-2010 John McCall <rjmccall@apple.com> Teach function-try-blocks on constructors and destructors to implicitly
rethrow. Fixes rdar://problem/7696603



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
744016dde06fcffd50931e94a98c850f8b12cd87 07-Jul-2010 John McCall <rjmccall@apple.com> Provide a hook for the benefit of clients using clang IR gen as a subroutine:
emit metadata associating allocas and global values with a Decl*. This feature
is controlled by an option that (intentionally) cannot be enabled on the command
line.

To use this feature, simply set
CodeGenOptions.EmitDeclMetadata = true;
and then interpret the completely underspecified metadata. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f1549f66a8216a78112286e3978cea2c29d6334c 06-Jul-2010 John McCall <rjmccall@apple.com> Validated by nightly-test runs on x86 and x86-64 darwin, including after
self-host. Hopefully these results hold up on different platforms.

I tried to keep the GNU ObjC runtime happy, but it's hard for me to test.
Reimplement how clang generates IR for exceptions. Instead of creating new
invoke destinations which sequentially chain to the previous destination,
push a more semantic representation of *why* we need the cleanup/catch/filter
behavior, then collect that information into a single landing pad upon request.

Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional
control flow) are generated, since it's actually fairly closely tied in with
the former. Remove the need to track which cleanup scope a block is associated
with.

Document a lot of previously poorly-understood (by me, at least) behavior.

The new framework implements the Horrible Hack (tm), which requires every
landing pad to have a catch-all so that inlining will work. Clang no longer
requires the Horrible Hack just to make exceptions flow correctly within
a function, however. The HH is an unfortunate requirement of LLVM's EH IR.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
121b3facb4e0585d23766f9c1e4fdf9018a4b217 05-Jul-2010 Chris Lattner <sabre@nondot.org> in the "coerce" case, the ABI handling code ends up making the
alloca for an argument. Make sure the argument gets the proper
decl alignment, which may be different than the type alignment.

This fixes PR7567


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
77b89b87c3b9220fea1bc80f6d6598d2003cc8a8 27-Jun-2010 Chris Lattner <sabre@nondot.org> finally get around to doing a significant cleanup to irgen:
have CGF create and make accessible standard int32,int64 and
intptr types. This fixes a ton of 80 column violations
introduced by LLVMContextification and cleans up stuff a lot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
35b21b884e5c3447a52a74d7ffaba966b07ac81f 27-Jun-2010 Chris Lattner <sabre@nondot.org> Change IR generation for return (in the simple case) to avoid doing silly
load/store nonsense in the epilog. For example, for:

int foo(int X) {
int A[100];
return A[X];
}

we used to generate:

%arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i64 %idxprom ; <i32*> [#uses=1]
%tmp1 = load i32* %arrayidx ; <i32> [#uses=1]
store i32 %tmp1, i32* %retval
%0 = load i32* %retval ; <i32> [#uses=1]
ret i32 %0
}

which codegen'd to this code:

_foo: ## @foo
## BB#0: ## %entry
subq $408, %rsp ## imm = 0x198
movl %edi, 400(%rsp)
movl 400(%rsp), %edi
movslq %edi, %rax
movl (%rsp,%rax,4), %edi
movl %edi, 404(%rsp)
movl 404(%rsp), %eax
addq $408, %rsp ## imm = 0x198
ret

Now we generate:

%arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i64 %idxprom ; <i32*> [#uses=1]
%tmp1 = load i32* %arrayidx ; <i32> [#uses=1]
ret i32 %tmp1
}

and:

_foo: ## @foo
## BB#0: ## %entry
subq $408, %rsp ## imm = 0x198
movl %edi, 404(%rsp)
movl 404(%rsp), %edi
movslq %edi, %rax
movl (%rsp,%rax,4), %eax
addq $408, %rsp ## imm = 0x198
ret

This actually does matter, cutting out 2000 lines of IR from CGStmt.ll
for example.

Another interesting effect is that altivec.h functions which are dead
now get dce'd by the inliner. Hence all the changes to
builtins-ppc-altivec.c to ensure the calls aren't dead.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
32f36baa6c8d491c374af622b4e3ac28d597453c 26-Jun-2010 Anders Carlsson <andersca@mac.com> Change EmitReferenceBindingToExpr to take a decl instead of a boolean.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ef66872797e46ced3ffdb428e582bc7f00474f99 25-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> IRGen for trivial initialization of dynamiccaly allocated
array of other done c++ objects. Fixes PR7490.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
564360be450b319aeafc26698be9811837bfb826 24-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to correctly mangle block helper functions
when block literal is declared inside a ctor/dtor.
Fixes radr 8096995.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7255a2d997b15beae82e627052fdb1b2474495c2 22-Jun-2010 Chris Lattner <sabre@nondot.org> implement support for -finstrument-functions, patch by Nelson
Elhage!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
810112e28dc839715d17b0a786f23aaa19600ac0 19-Jun-2010 Chris Lattner <sabre@nondot.org> Fix PR7097, a bad interaction between -fno-use-cxa-atexit and
-mconstructor-aliases by using a WeakVH instead of a raw pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
03b2960c14aede6ac82bdef32247094ebb72fa69 17-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Objective-c++ IRGen. Support for @selector expression as
an lvalue. Fixes PR7390.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
61eecf5aea018ea65c9ab0bccacd2996b15c632d 14-Jun-2010 Nate Begeman <natebegeman@mac.com> Add some missing shifts
Fix multiplies by scalar
Add SemaChecking code for all immediates
Add SemaChecking-gen support to arm_neon.td


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
464ccb68f22a7e1c0a2844551c16f721540c91c3 12-Jun-2010 Nate Begeman <natebegeman@mac.com> Most of remaining builtins, 2 generics, vld, and rounding shfits remain.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d075c01c359b9cc120c3accc7166990f9f4ac423 10-Jun-2010 Nate Begeman <natebegeman@mac.com> support _lane ops, and multiplies by scalar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5687a5cb5941744c42aaaa9a1e7cd6d7c4c07fbf 09-Jun-2010 Anders Carlsson <andersca@mac.com> Rename __tcf_ to __cxx_global_array_dtor. Remove the UniqueAggreDestructorCount from CodeGenFunction and let LLVM handle uniquing the internal functions instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
02e370a02f05b4a734fe5e8c88efc4ed9dac60fa 09-Jun-2010 Anders Carlsson <andersca@mac.com> Simplify GenerateCXXAggrDestructorHelper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
30d91718a676177f0d0d0210ce4fdb4f616df6e5 08-Jun-2010 Nate Begeman <natebegeman@mac.com> Fix NEON intrinsic argument passing, support vext. Most now successfully make it through codegen to the .s file


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2736071ea3a46f90e65c93418961611d96c10ab9 27-May-2010 John McCall <rjmccall@apple.com> Correctly pass aggregates by reference when emitting thunks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1884eb0b5c55edda4893ddec45e7dbad79758782 22-May-2010 Anders Carlsson <andersca@mac.com> Re-land the fix for PR7139.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ef072fd2f3347cfd857d6eb787b245b950771430 22-May-2010 John McCall <rjmccall@apple.com> Push a return-value slot throughout ObjC message-send codegen. Will be
critical for ObjC++ correctness; hard to test independently of various
required Sema changes, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
892fa6c5e152dd22e4ba460d5c8cd5c79d657e87 22-May-2010 Anders Carlsson <andersca@mac.com> Unbreak self-host.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104390 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
db9b12e32c988e4a6ac49404fd2513d0b05bba32 21-May-2010 Anders Carlsson <andersca@mac.com> Rename CodeGenFunction::EmitMemSetToZero to EmitNullInitialization. Handle setting null data member pointers correctly. Fixes PR7139.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ee5042903d53fa7b0fbc1902d0ea07d57c7775b1 21-May-2010 John McCall <rjmccall@apple.com> Allocate space in a block record for implicit references to the Objective C
'self' variable arising from uses of the 'super' keyword. Also reorganize
some code so that BlockInfo (now CGBlockInfo) can be opaque outside of
CGBlocks.cpp.

Fixes rdar://problem/8010633.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a9976d3b192690db20f59dc44099ac4ca939bdb7 21-May-2010 John McCall <rjmccall@apple.com> When emitting an lvalue for an anonymous struct or union member during
class initialization, drill down through an arbitrary number of anonymous
records.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104310 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ea1471e0e967548c596a71469702f8846dbaf3c0 20-May-2010 John McCall <rjmccall@apple.com> Support implicitly closing on 'this' in a block. Fixed PR7165.

(the codegen works here, too, but that's annoying to test without execution)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3d91bbcdab155181556969cad6ec97014405aced 17-May-2010 Douglas Gregor <dgregor@apple.com> Ensure that destructors are called for NRVO'd objects when the
function does not return. Thanks to Eli for pointing out this corner
case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
86a3a03667bdb0dcab7e6a2877dfd234b07a6d43 16-May-2010 Douglas Gregor <dgregor@apple.com> When initializing thread-safe statics, put the call to
__cxa_guard_abort along the exceptional edge into (in effect) a nested
"try" that rethrows after aborting. Fixes PR7144 and the remaining
Boost.ProgramOptions failures, along with the regressions that r103880
caused.

The crucial difference between this and r103880 is that we now follow
LLVM's little dance with the llvm.eh.exception and llvm.eh.selector
calls, then use _Unwind_Resume_or_Rethrow to rethrow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1eb2e59338c4b9c0429fc39ca98662adc9e7a3f2 16-May-2010 Douglas Gregor <dgregor@apple.com> Revert r103880 (thread-safe static initialization w/ exceptions),
because it's causing strange linker errors. Unfixes PR7144.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bfcc823a5c53dabab8cfc842bfea70e2b69cdee0 15-May-2010 Douglas Gregor <dgregor@apple.com> When initializing thread-safe statics, put the call to
__cxa_guard_abort along the exceptional edge into (in effect) a nested
"try" that rethrows after aborting. Fixes PR7144 and the remaining
Boost.ProgramOptions failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5e37d48a4988cb8ff776009876b7fd1a7504b4eb 14-May-2010 Anders Carlsson <andersca@mac.com> Remove an unused function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
fb8cc253420e93cee33d29df5a2bdae6aaf16e39 05-May-2010 Douglas Gregor <dgregor@apple.com> Reimplement code generation for copying fields in the
implicitly-generated copy constructor. Previously, Sema would perform
some checking and instantiation to determine which copy constructors,
etc., would be called, then CodeGen would attempt to figure out which
copy constructor to call... but would get it wrong, or poke at an
uninstantiated default argument, or fail in other ways.

The new scheme is similar to what we now do for the implicit
copy-assignment operator, where Sema performs all of the semantic
analysis and builds specific ASTs that look similar to the ASTs we'd
get from explicitly writing the copy constructor, so that CodeGen need
only do a direct translation.

However, it's not quite that simple because one cannot explicit write
elementwise copy-construction of an array. So, I've extended
CXXBaseOrMemberInitializer to contain a list of indexing variables
used to copy-construct the elements. For example, if we have:

struct A { A(const A&); };

struct B {
A array[2][3];
};

then we generate an implicit copy assignment operator for B that looks
something like this:

B::B(const B &other) : array[i0][i1](other.array[i0][i1]) { }

CodeGen will loop over the invented variables i0 and i1 to visit all
elements in the array, so that each element in the destination array
will be copy-constructed from the corresponding element in the source
array. Of course, if we're dealing with arrays of scalars or class
types with trivial copy-assignment operators, we just generate a
memcpy rather than a loop.

Fixes PR6928, PR5989, and PR6887. Boost.Regex now compiles and passes
all of its regression tests.

Conspicuously missing from this patch is handling for the exceptional
case, where we need to destruct those objects that we have
constructed. I'll address that case separately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
43373963ac204ff491ec8851e706eb7423f951ce 03-May-2010 Anders Carlsson <andersca@mac.com> Remove OldGetAddressOfBaseClass - bye bye ambiguities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4235840554aaed11efd479df9e622dc82ab77e6d 03-May-2010 Anders Carlsson <andersca@mac.com> More work towards getting rid of OldGetAddressOfBaseClass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8e6404ca28d6bbb76e97ea2a53a74816c2a74665 03-May-2010 Anders Carlsson <andersca@mac.com> Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
155ed4a23366f4514befb1c9f5f89d16f8b8b6db 03-May-2010 Anders Carlsson <andersca@mac.com> Revert my last change and add a 'ForVirtualBase' parameter to EmitCXXConstructorCall instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
24eb78e38aba55c507bc3c05c37035a9ab2defa7 03-May-2010 Anders Carlsson <andersca@mac.com> Pass the construction kind down to EmitCXXConstructorCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
82929316ccfcc1a7674f12195f93b41c91a28bd4 02-May-2010 Anders Carlsson <andersca@mac.com> Remove another unused function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
05dd1f6292bd39cbd75ef3dd641b5fc66b7c22ca 02-May-2010 Anders Carlsson <andersca@mac.com> Remove an unused function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4b02afcb45cd1a384de7d45f440a8be091dd500b 02-May-2010 David Chisnall <csdavec@swan.ac.uk> As per Chris' request, return the Instruction from EmitCall and add the metadata in the caller.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
06a9f3680d22529a2fcf20c52d71cf221d99d910 01-May-2010 Douglas Gregor <dgregor@apple.com> Complete reimplementation of the synthesis for implicitly-defined copy
assignment operators.

Previously, Sema provided type-checking and template instantiation for
copy assignment operators, then CodeGen would synthesize the actual
body of the copy constructor. Unfortunately, the two were not in sync,
and CodeGen might pick a copy-assignment operator that is different
from what Sema chose, leading to strange failures, e.g., link-time
failures when CodeGen called a copy-assignment operator that was not
instantiation, run-time failures when copy-assignment operators were
overloaded for const/non-const references and the wrong one was
picked, and run-time failures when by-value copy-assignment operators
did not have their arguments properly copy-initialized.

This implementation synthesizes the implicitly-defined copy assignment
operator bodies in Sema, so that the resulting ASTs encode exactly
what CodeGen needs to do; there is no longer any special code in
CodeGen to synthesize copy-assignment operators. The synthesis of the
body is relatively simple, and we generate one of three different
kinds of copy statements for each base or member:

- For a class subobject, call the appropriate copy-assignment
operator, after overload resolution has determined what that is.
- For an array of scalar types or an array of class types that have
trivial copy assignment operators, construct a call to
__builtin_memcpy.
- For an array of class types with non-trivial copy assignment
operators, synthesize a (possibly nested!) for loop whose inner
statement calls the copy constructor.
- For a scalar type, use built-in assignment.

This patch fixes at least a few tests cases in Boost.Spirit that were
failing because CodeGen picked the wrong copy-assignment operator
(leading to link-time failures), and I suspect a number of undiagnosed
problems will also go away with this change.

Some of the diagnostics we had previously have gotten worse with this
change, since we're going through generic code for our
type-checking. I will improve this in a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
43db20e9550ecf2b215ddb76eaff82a3b466de96 01-May-2010 Anders Carlsson <andersca@mac.com> Simplify EmitClassAggrMemberwiseCopy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f62756f45b5254ba7faa4e5cd848b4ad08c18824 01-May-2010 Anders Carlsson <andersca@mac.com> Clean up EmitClassMemberwiseCopy further.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102846 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1d1d1185b46173107f5292a16e3a6ca4d60f7486 01-May-2010 Anders Carlsson <andersca@mac.com> Get rid of a parameter from EmitClassMemberwiseCopy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
dd5c98f709837e5dd3da08d44d1ce407975df2cf 01-May-2010 David Chisnall <csdavec@swan.ac.uk> Tweaked EmitCall() to permit the caller to provide some metadata to attach to the call site.

Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
106d9ea61c7211b370c5b97a0288652c23da329a 30-Apr-2010 Anders Carlsson <andersca@mac.com> Remove an unnecessary parameter from EmitClassCopyAssignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9ffdd45c56e2f143016f6c78fe2d7ca652c1b57a 30-Apr-2010 Anders Carlsson <andersca@mac.com> Remove an unnecessary argument to EmitClassCopyAssignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
109dfc6ca6652f60c55ed0f2631aebf323d0200d 28-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> IRGen for initialization/destruction of
ivar class objects (NeXt runtime).
(radar 7900343).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8e142ccf1196c9ae31f10f9caa97670e343971e7 25-Apr-2010 Anders Carlsson <andersca@mac.com> Revert enough of my patches to fix self-host again :(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8561a8666c70f924c8f0209c41b9b77bbbf90607 25-Apr-2010 Anders Carlsson <andersca@mac.com> RenameGetAddressOfBaseOfCompleteClass to GetAddressOfDirectBaseInCompleteClass to reflect that it only handles direct bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f500de5bdfa1ab8e6944bb3519c2ae27f87c414b 25-Apr-2010 Anders Carlsson <andersca@mac.com> More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6444c417b4e8eaf1893c641f5a246f5adbb761c4 25-Apr-2010 Anders Carlsson <andersca@mac.com> Simplify EmitClassMemberwiseCopy now that it's only used for fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a88ad5618fcb07c5374c79d6781a33234984b039 24-Apr-2010 Anders Carlsson <andersca@mac.com> Rename GetAddressOfBaseClass to OldGetAddressOfBaseClass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a04efdf635d35d88e65041fad007225d8c8d64a5 24-Apr-2010 Anders Carlsson <andersca@mac.com> Change CodeGenFunction::GetAddressOfDerivedClass to take a BasePath.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
34a2d384c745ebc39cae45dc1c0c4a6a7012e09b 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add a new GetAddressOfBaseClass overload that takes a base path and. Use it for derived-to-base casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6a03e345bb3c971750920e34a0d7d1ea7c9eceb7 23-Apr-2010 Douglas Gregor <dgregor@apple.com> Handle compound assignment expressions (i += j) as lvalues, which is
permitted in C++ but not in C. Fixes PR6900. Clang can now handle all
of Boost.Lambda's regression tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ac418162692a951ca3796d6830496a85a2d12493 22-Apr-2010 John McCall <rjmccall@apple.com> Call PerformCopyInitialization to properly initialize the exception temporary
in a throw expression. Use EmitAnyExprToMem to emit the throw expression,
which magically elides the final copy-constructor call (which raises a new
strict-compliance bug, but baby steps). Give __cxa_throw a destructor pointer
if the exception type has a non-trivial destructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
548ce5e78215a34f409d597bb2c1e9f897a8eda3 21-Apr-2010 John McCall <rjmccall@apple.com> I failed to notice that my last patch wasn't doing as much as it could
because EmitBranch actually clears the insert point. This version
actually accomplishes what I initially wanted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3d3ec1c099ec8bfac3aa1fb0126fe515b7c7fa05 21-Apr-2010 John McCall <rjmccall@apple.com> Miscellaneous codegen cleanups. Mostly, don't create new basic blocks
just to save the current insertion state! This change significantly
simplifies the IR CFG in exceptions code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3e79c30807c516e8d32e4ed08408b30605df5997 20-Apr-2010 Anders Carlsson <andersca@mac.com> Back out r101911 and see if it makes the bots happy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
36fd6beef1ffaf93217d8ce96d900d4ed817e463 20-Apr-2010 Anders Carlsson <andersca@mac.com> Fix a bug which triggered the assertion I added yesterday. Basically, when we initialize the vtable pointer for a virtual base, and there was another path from the most derived class to another base with the same class type, we would use the wrong base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b3b772ea15a4cd54879e244629aa685ead9548bb 20-Apr-2010 Anders Carlsson <andersca@mac.com> Pass the nearest virtual base decl to InitializeVTablePointers. No functionality change right now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
15bd58842adaa4f8cca4e58047ed18e033858d9b 13-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Variation of objc_copyStruct API generation when
property (atomic/nonatomic) is of aggregate type with
gc'able member objects) (NeXT runtime).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0b2bd47151ee9205ad6c66d1ffb921918106088a 13-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Add support for objc_copyStruct to enforce
atomicity of aggregate properties in setter/getter
methods. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6876fe615e16b0e76c7711e129e470305b7e9d41 31-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Minor include pruning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
21c9ad9d29d08a287292c670e7c52bc522c7f8bb 30-Mar-2010 Anders Carlsson <andersca@mac.com> Factor emitting a call to a copy constructor out into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
44ec82b4a1597802f5bf17721481b8c265bc8dc5 30-Mar-2010 Anders Carlsson <andersca@mac.com> Introduce a CXXTemporariesCleanupScope RAII object and use it to cleanup the temporaries code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
603d6d12cc4cba1ef219a3d55c698c7c87f87adf 28-Mar-2010 Anders Carlsson <andersca@mac.com> Reapply r99775 with a fix for a silly bug - we were setting the vtable pointer for all bases, even those without a vtable pointer :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99777 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4658990ac17046bfe7a30c45c9faea9e617eb479 28-Mar-2010 Anders Carlsson <andersca@mac.com> Looks like I broke self-host again :(.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bdb88655204ec14a20e51210bd50e84fe2f1cee9 28-Mar-2010 Anders Carlsson <andersca@mac.com> More improvements to setting the vtable pointer. We now no longer set the vtable pointer for non-virtual primary bases. We also do a pre-order traversal of the class hierarchy; this is necessary in order to get the right vbase offset offsets in base ctors/dtors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d103f9f9b401b419e756f8c1849683cd77586067 28-Mar-2010 Anders Carlsson <andersca@mac.com> Factor vtable pointer setting code out into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0703690603bd197b581ceb2fb9a020aa88b9a106 26-Mar-2010 Anders Carlsson <andersca@mac.com> Simplify InitializeVtablePtrs in preparation of making it work with construction vtables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5c6c1d9eca7ce932eff011cd3e592f606e60b4be 24-Mar-2010 Anders Carlsson <andersca@mac.com> More vtable work; preparations for moving over to the new vtable layout code (finally).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f532f3b4a642ad5d9704c4a1d17b61cc52ab2f65 24-Mar-2010 Anders Carlsson <andersca@mac.com> Remove old thunks code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
519c32880b99396034ecaedc0cd86db2e8485003 24-Mar-2010 Anders Carlsson <andersca@mac.com> Add CodeGenFunction::GenerateThunk and implement it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
efb0fa9e11f75af51744a6159530ef7cc8efa24a 20-Mar-2010 Daniel Dunbar <daniel@zuster.org> C++: Add support for -fno-use-cxa-atexit.
- So much typing, so little gain...

Also, rename the __cxx_global_initialization function just to match llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5c6846e64b8bbf620636dd688137a27ca8e66aa2 20-Mar-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Inline GenerateCXXGlobal[VarDecl]InitFunc into sole caller.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2752c0137d95aa2f4ee1cdff4b564bac842e041b 03-Mar-2010 Chris Lattner <sabre@nondot.org> add framework for ARM builtins, Patch by Edmund Grimley Evans!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
492c4f998d848673d3d6c9e6416115df4036a71d 03-Mar-2010 John McCall <rjmccall@apple.com> Add proper target hooks for __builtin_extract_return_address and
__builtin_frob_return_address. The implementations for both are
still trivial in the default case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2a7eb28397148079cbc8e54e8a3871ef01c4f4bc 23-Feb-2010 Blaine Garst <blaine@apple.com> Unconditionally support block introspection data in a new field at the end
of the block descriptor field. This field is the ObjC style @encode
signature of the implementation function, and was to this point
conditionally provided in the block literal data structure. That
provisional support is removed.

Additionally, eliminate unused enumerations for the block literal flags field.
The first shipping ABI unconditionally set (1<<29) but this bit is unused
by the runtime, so the second ABI will unconditionally have (1<<30) set so
that the runtime can in fact distinguish whether the additional data is
present or not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c0bf462cf35fe050bddbd8bff967298e4a67e79d 23-Feb-2010 John McCall <rjmccall@apple.com> Perform two more constructor/destructor code-size optimizations:

1) emit base destructors as aliases to their unique base class destructors
under some careful conditions. This is enabled for the same targets that can
support complete-to-base aliases, i.e. not darwin.

2) Emit non-variadic complete constructors for classes with no virtual bases
as calls to the base constructor. This is enabled on all targets and in
theory can trigger in situations that the alias optimization can't (mostly
involving virtual bases, mostly not yet supported).

These are bundled together because I didn't think it worthwhile to split them,
not because they really need to be.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9fc6a7774643a810c8501dae2323e863fefb623e 19-Feb-2010 John McCall <rjmccall@apple.com> More refactoring around constructor/destructor code generation.
Fix some bugs with function-try-blocks and simplify normal try-block
code generation.

This implementation excludes a deleting destructor's call to
operator delete() from the function-try-block, which I believe
is correct but which I can't find straightforward support for at
a moment's glance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a355e07454463b19829ac92ffd115a097faff0e0 18-Feb-2010 John McCall <rjmccall@apple.com> Extract out function-body code generation into its own method. No functionality
change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2504941793b549323f9d29c62507cf21d865fade 16-Feb-2010 John McCall <rjmccall@apple.com> IRgen optimization: cache the value of 'this' and 'vtt' instead of
repeatedly reloading from an alloca. We still need to create the alloca
for debug info purposes (although we currently create it in all cases
because of some abstraction boundaries that're hard to break down).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96403 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9bd4da2cfa8b956b851200db8f9a37e175edbb15 16-Feb-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Add CreateIRTemp, which creates a temporary alloca but with type converted "not-for-memory". Dunno a better name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bff225ecf77fb891596ecb1b27196310d268365e 16-Feb-2010 John McCall <rjmccall@apple.com> When emitting complete destructors for classes with virtual bases, compute
the offset to the virtual bases statically inside of relying on the virtual
base offsets in the object's vtable(s). This is both more efficient and
sound against the destructor's manipulation of the vtables.

Also extract a few helper routines.

Oh and we seem to pass all tests with an optimized clang now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
195337d2e5d4625ae9dc1328c7cdbc7115b0261b 09-Feb-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Add CreateMemTemp, for creating an temporary memory object for a particular type, and flood fill. - CreateMemTemp sets the alignment on the alloca correctly, which fixes a great many places in IRgen where we were doing the wrong thing.

- This fixes many many more places than the test case, but my feeling is we need to audit alignment systematically so I'm not inclined to try hard to test the individual fixes in this patch. If this bothers you, patches welcome!

PR6240.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f6b89a173827457c28ac77b7cf091a24ef484e8a 07-Feb-2010 Anders Carlsson <andersca@mac.com> Use the right linkage for static variables inside C++ inline functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
18aba0dd518e486d8b50523e7dafb4b5657135d2 05-Feb-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Factor out EmitAggExprToLValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
72119a887c4af39c90f10b6bdc158389071f42ea 04-Feb-2010 Anders Carlsson <andersca@mac.com> Rename StartConditionalBranch/FinishConditionalBranch to BeginConditionalBranch/EndConditionalBranch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a64a869312066ff6119d1d7ae03f88ce499e3f82 03-Feb-2010 Anders Carlsson <andersca@mac.com> Revert the new reference binding code; I came up with a way simpler solution for the reference binding bug that is preventing self-hosting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
3aba09376c5f49c4c8d176109ea4835bc2c528ee 31-Jan-2010 Anders Carlsson <andersca@mac.com> Start creating CXXBindReferenceExpr nodes when binding complex types to references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
06a2970e9480c6d02b367b2f970baff29b9f9721 29-Jan-2010 Anders Carlsson <andersca@mac.com> Add a new EmitLValueForFieldInitialization that will be used for initializing fields (and reference type fields in particular).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e6d2a534851a649485cb087e9dfcaf8a65886858 29-Jan-2010 Anders Carlsson <andersca@mac.com> Simplify EmitLValueForField - we can get whether the field is part of a union or not from the FieldDecl (through its DeclContext).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
30a8a272f091054ce92b9daa1992bcff887c3ee4 26-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Use CharUnits for alignments in character units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
08e9e453f40aff95a59bd67db49b8f050765e1f0 24-Jan-2010 Anders Carlsson <andersca@mac.com> Fix a nasty bug where temporaries weren't marked as being conditional in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
199c3d6cd16aebbb9c7f0d42af9d922c9628bf70 11-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.

Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
dd36d328730d8c02915d0884541b45ec6ca0049d 09-Jan-2010 Chris Lattner <sabre@nondot.org> refactor pre/postinc logic into CGF and require the caller to pass in the
lvalue to poke, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6c6bda3b0b1d8adaac2ba3f4da7056e9f1eef52e 08-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR5967: Make const-marking for LLVM globals correct for cases requiring
run-time initialization, and emit run-time initializers aggresively to avoid
ordering issues with deferred globals.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
696f87bc39652992516fa7ca8399c38f3faae826 03-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Get rid of more dead code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
21431c551d867962c66c92f0f96f652678f64c1c 02-Jan-2010 Anders Carlsson <andersca@mac.com> Move address points to CGVtableInfo, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c997d4278d329e18891aac9698fb991b2d4622eb 02-Jan-2010 Anders Carlsson <andersca@mac.com> Correctly pass VTT parameters to constructors and destructors. The VTTs aren't yet used in the ctors/dtors, but that will follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92409 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a1736c0c750d4514a5d8fda36670addf1e4de54a 24-Dec-2009 Anders Carlsson <andersca@mac.com> Pass the return value slot to all call exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d2490a91341b57df7a7e54f8a707e7ecde2eeb4e 24-Dec-2009 Anders Carlsson <andersca@mac.com> Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us halfway towards fixing PR5824.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f3c47c9525153aea2de0ec4bd615b9cf2d81c103 24-Dec-2009 Anders Carlsson <andersca@mac.com> Pass ReturnValueSlot to EmitCall. No functionality change yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
31777a2540879051a3c643b90e02c3fd3d315243 24-Dec-2009 Anders Carlsson <andersca@mac.com> Add a ReturnValueSlot class. Change the argument order in EmitCall to match the other overload better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e12e77bed10f87bdc7305d0dbd1de89e48f280c1 19-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Work in progress for setting the vtable pointers for all bases correctly in
the constructor. This doesn't handle cases requiring the VTT at the moment,
and generates unnecessary stores, but I think it's essentially correct.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b14e62d5aee7522b98c410ee65bd750c2cfe6f01 16-Dec-2009 Mike Stump <mrs@apple.com> Implement additional undefined checks for additional loads and stores. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
15037caa1542bb810ad54c653aeb80f61df7b00c 15-Dec-2009 Mike Stump <mrs@apple.com> Switch codegen for -fcatch-undefined-bahavior over to __builtin_trap
instead of abort to improve codesize and codegen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
be07f60131bc6f8d6696f4644df1ef667a1730d5 14-Dec-2009 Mike Stump <mrs@apple.com> Add support for detecting undefined shift behavior. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9c276ae0f24d4cee8f7954069d4b8eae45d0447d 12-Dec-2009 Mike Stump <mrs@apple.com> Implement runtime checks for undefined behavior. WIP.

This implements a new flag -fcatch-undefined-behavior. The flag turns
on additional runtime checks for:

T a[I];

a[i] abort when i < 0 or i >= I.

Future stuff includes shifts by >= bitwidth amounts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
940670512d7c3d93389bb38a426abcb7ef44271e 10-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Get rid of static variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91041 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
182f383db1782af752ecaf607fdff72a8542088b 10-Dec-2009 Mike Stump <mrs@apple.com> Ensure we only generate one terminate handler.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
20d3a53cef96ed1d42ec82a313e8453cfef6512b 10-Dec-2009 Mike Stump <mrs@apple.com> Add terminate handler to cleanups on exceptional edges.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
820bca41c3899374775d2a1dfc2ef2e22aaf1c7b 10-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Code gen for ObjCIsaExpr AST used as lvalue.
(fixes radar 7457534).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9b39c51ae3c547568ac42325f94b4197618f6b18 09-Dec-2009 Mike Stump <mrs@apple.com> Break out code for reuse. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d88ea5687968640ada2bc5a10211cbeb68a671ec 09-Dec-2009 Mike Stump <mrs@apple.com> Add cleanups for exceptional edges. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
77a259c6dbf582949af8a243b472c0c7faa373a6 08-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5707: make sure implicit copy constructors initialize the vtable
pointer.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
cce3d4f9812182ed4e551b7cf0fc86576be8d9c5 08-Dec-2009 Mike Stump <mrs@apple.com> Add codegen support for exception specifications. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
761acc19d966a67f2175783d09412d6ac9463400 05-Dec-2009 Chris Lattner <sabre@nondot.org> implement rdar://7346691 by codegen'ing struct/array initializers
to a memset or a memcpy from a global when possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6a1e0eb557d47e85185e09bdf8721f53f4bf9c9c 05-Dec-2009 Mike Stump <mrs@apple.com> Add support for function try blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b17daf9ab790ae71aacad2cc4aa11cd8d86c25d1 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make functions returning a struct indirectly evaluate the returned struct
directly into the sret pointer. This is an optimization in C, but is required
for correctness in C++ for classes with a non-trivial copy constructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
35c98cc4c00efcfe47ad0b716e7c50afb9c5ff75 03-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Minor cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
919d5e51fd0a1b6e52028c8aa42edf44ee036954 03-Dec-2009 Mike Stump <mrs@apple.com> Add support for thunking dtors. Oh why does this make my head hurt?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90409 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
99533834ba8f3658559f334e68a518ebb6388cea 02-Dec-2009 Mike Stump <mrs@apple.com> More exception handling improvements... WIP.

Highlights include:

Add a helper to generate __cxa_free_exception and _ZSt9terminatev.
Add a region to handle EH object deallocation for ctor failures for throw.
Add a terminate handler for __cxa_end_catch.
A framework for adding cleanup actions for the exceptional edges only.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f71d232ce5354bd2f0c94ded30fb936c2a3d968b 30-Nov-2009 Mike Stump <mrs@apple.com> Reflow comments and fix 80-col violation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7622cd3410846d28862ecfe862117894a259a7fa 26-Nov-2009 Anders Carlsson <andersca@mac.com> Add a CovariantThunkAdjustment struct that represents the adjustments needed for a covariant thunk.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a94822e8937eeb340a653b88024f805a07a2d2ee 26-Nov-2009 Anders Carlsson <andersca@mac.com> Add a ThunkAdjustment struct which holds a non-virtual and a virtual adjustment offset. Start using it. General cleanup in Mangle.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f6c56e2323c3f973253805a2f35629f3253ebed4 25-Nov-2009 Anders Carlsson <andersca@mac.com> Add VTT parameter to base ctors/dtors with virtual bases. (They aren't used yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
99e9b4d172f6877e6ba5ebe75bb8238721f5e01c 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXConditionDeclExpr with extreme prejudice.

All statements that involve conditions can now hold on to a separate
condition declaration (a VarDecl), and will use a DeclRefExpr
referring to that VarDecl for the condition expression. ForStmts now
have such a VarDecl (I'd missed those in previous commits).

Also, since this change reworks the Action interface for
if/while/switch/for, use FullExprArg for the full expressions in those
expressions, to ensure that we're emitting

Note that we are (still) not generating the right cleanups for
condition variables in for statements. That will be a follow-on
commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5656e14d91405417182171a705ed3e3d2d6d7aa3 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Clean up the AST for while loops and fix several problems with
cleanups for while loops:

1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g.,

while (shared_ptr<WorkInt> p = getWorkItem()) {
// ...
}

2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g.,

while (blah)
RAIIObject raii(blah+1);



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5d4d946ec2d88696fd8422aeb64dc29688e6a2c1 24-Nov-2009 Anders Carlsson <andersca@mac.com> Handle cases where we're constructing an array of objects and the constructor has default arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
01234bbc1cb94946df8046ad95e17537082b4f71 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Introduce cleanup scopes for "if" statements in two places:
- Outside the "if", to ensure that we destroy the condition variable
at the end of the "if" statement rather than at the end of the
block containing the "if" statement.
- Inside the "then" and "else" branches, so that we emit then- or
else-local cleanups at the end of the corresponding block when the
block is not a compound statement.

To make adding these new cleanup scopes easier (and since
switch/do/while will all need the same treatment), added the
CleanupScope RAII object to introduce a new cleanup scope and make
sure it gets cleaned up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d5782d5013ef5dbe033d1c3d1334e01c5996e06b 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Rename CleanupScope -> DelayedCleanupBlock. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a3697c9c155bda93fd2802f37084b620f4738822 23-Nov-2009 Anders Carlsson <andersca@mac.com> Handle base-to-derived casts. Will land test case shortly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a36bf8f74180e834c6bf2db867796fd5338495ab 20-Nov-2009 Anders Carlsson <andersca@mac.com> Fix lifetime of conditional temporaries. Patch by Victor Zverovich!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
44b0a3e858af7b19f489619e52cd58970611cd15 18-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add an assertion to catch bad calls to EmitCallArgs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4bf8152799ec41796f989ea1b94f6f1bac349117 18-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Missing piece of r89173.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0ed303c918915cbe2c611cddbfabd00404664831 17-Nov-2009 Anders Carlsson <andersca@mac.com> More const is always good.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c849c052d6b4b70f2651c1969531861a5f230053 16-Nov-2009 Mike Stump <mrs@apple.com> Implement most of dynamic_cast. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c2e84ae9a6d25cea3e583c768e576b4c981ec028 15-Nov-2009 Mike Stump <mrs@apple.com> Implement typeid for class types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
72c2153b466263a21870b2b1c817900d4981493e 13-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Code gen for arrady delete operator. Fixes pr5472.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
444be7366d0a1e172c0290a1ea54c1cb16b5947c 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
566abee1e9828a7700b51e4d17ea08234fde3bb4 13-Nov-2009 Anders Carlsson <andersca@mac.com> Add a special BuildVirtualCall that's going to be used for building calls to destructors. This is needed because when compiling:

struct A {
virtual ~A();
};

void f(A* a) {
delete a;
}

A's deleting destructor should be called.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
88f4280f6b60edcbdea6a38a3da8b17d66473ad6 10-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> This patch implements Code gen. for destruction of
global array of objects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
380dd759b33fd059b1aa7dbd85f8e66ca32f7bdc 10-Nov-2009 Mike Stump <mrs@apple.com> Add vtable caching to prevent multiple vtables for the same class from
being generated.

Add the most derived vtable pointer to the VTT.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
fbfb52d4cf10b4fd1ac19d1445fe2ffcb9c2bbf1 10-Nov-2009 Mike Stump <mrs@apple.com> Be sure to clear out VCall when we clear out VCalls.

Start implementing VTTs. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
909fbf70223ea04a5ec8d449789f3683a89701ff 07-Nov-2009 Anders Carlsson <andersca@mac.com> Change EmitPointerToDataMemberLValue to take a FieldDecl. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
7799621ad7d16f3c6a1aeda024312d63ecd77777 04-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> This patch extends CleanupScope to support destruction
of array objects on block exit. Patch is by Anders Calrsson.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
df317bf71653eeb235da8337b1e8e790f9653aa4 04-Nov-2009 Mike Stump <mrs@apple.com> Refine volatile handling, specifically, we must have the canonical
type to look at the volatile specifier. I found these all from just
hand auditing the code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c902d22129322731607988dafb8cd7f708eb75b1 03-Nov-2009 Mike Stump <mrs@apple.com> Refine return value adjustments for thunks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
756b5c4f9d52642d87d1948bee58f97a4f795b24 30-Oct-2009 Anders Carlsson <andersca@mac.com> Add CGException.cpp, to be used for exception related code generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85560 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d8ee95fd4fb8fb00ad999dffad5fa1613c68a113 29-Oct-2009 Chris Lattner <sabre@nondot.org> optimize out some ifdefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
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/CodeGenFunction.h
8bfd31f9dad09cd52225d868bbd92a9bebe87775 23-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Complete code gen for '.*' binary expression for
both scalar and aggregates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a63629930177da7a0eb99c3fdfb35d8618808ca1 21-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Code gen for pointer-to-datamember - WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ea26cb522e88fc86b0d1cae61dcefcfe4cc20231 21-Oct-2009 Mike Stump <mrs@apple.com> Prep work to always preallocate BlockDeclRefExprs so that we can
generate the debug information for the first parameter to the block
invoke functions. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
48620bafe4ba879f96c2d17caefeb79f3fae2eea 21-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Code-gen for CXXZeroInitValueExpr AST passed
as argument to a function call. Removes a FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
259e9ccf882d11491ad149aec5e6d7a061c9f938 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Twinify CodeGenFunction::CreateTempAlloca

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84456 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3d00fdc82fd550ae4bfbb2e700a1fc85bbd6d6fd 13-Oct-2009 Chris Lattner <sabre@nondot.org> reimplement codegen for indirect goto with the following advantages:

1. CGF now has fewer bytes of state (one pointer instead of a vector).
2. The generated code is determinstic, instead of getting labels in
'map order' based on pointer addresses.
3. Clang now emits one 'indirect goto switch' for each function, instead
of one for each indirect goto. This fixes an M*N = N^2 IR size issue
when there are lots of address-taken labels and lots of indirect gotos.
4. This also makes the default cause do something useful, reducing the
size of the jump table needed (by one).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2f1986b557fa671c4f8c9dd0d071398edfc073d5 07-Oct-2009 Anders Carlsson <andersca@mac.com> Change GetAddressCXXOfBaseClass to use CXXBasePaths for calculating base class offsets. Fix the code to handle virtual bases as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
375c31c4673f83f925de221752cf801c2fbbb246 03-Oct-2009 Anders Carlsson <andersca@mac.com> Implement code generation of member function pointer calls. Fixes PR5121.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2b3583573ba6b26b605aacaad9a50492fb3d6fe6 03-Oct-2009 Anders Carlsson <andersca@mac.com> Move some functions from CodeGenFunctions to CodeGenModule so they can be used by CGExprConstant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
84080ec16ede6a6fe85a1d991690c6bda82a59ee 29-Sep-2009 Anders Carlsson <andersca@mac.com> Handle CK_BaseToDerivedMemberPointer for member function pointers. Fixes PR5091.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83041 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6815e941998659a55c20c147861b0f437928c3d8 27-Sep-2009 Anders Carlsson <andersca@mac.com> CodeGen for try statements. (We just emit the body for now).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0953e767ff7817f97b3ab20896b229891eeff45b 24-Sep-2009 John McCall <rjmccall@apple.com> Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right; many more remain.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
569c1f4a6c703eaa8b963bed7d5c2fd5d4569e93 23-Sep-2009 Anders Carlsson <andersca@mac.com> Add a new variant of EmitCXXAggrConstructorCall that takes a Value that holds the number of elements to construct, to be used when implementing new[].

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6fcec8b58d0571866fcb162db947b029cc539ec4 15-Sep-2009 Anders Carlsson <andersca@mac.com> Code generation of Conditional operators that are lvalues (but that aren't bitfields).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
de1d26b9c1d8823b173e4d77015ad88b4da70559 14-Sep-2009 Anders Carlsson <andersca@mac.com> Remove an unnecessary FunctionDecl parameter to the synthesizing functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b9ea0b53d323cdca2b8284ff986a878e195cb97f 14-Sep-2009 Anders Carlsson <andersca@mac.com> Implement CodeGenFunction::EmitCXXExprWithTemporariesLValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5a0f49ebc83e7fe0da07b9964c44b0a7fae270cb 12-Sep-2009 Anders Carlsson <andersca@mac.com> Rename AddressCXXOfBaseClass to GetAddressCXXOfBaseClass. Add a NullCheckValue argument (currently unused).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7dfa4079f4b37507048b19bfc693d3b015d9dd11 12-Sep-2009 Anders Carlsson <andersca@mac.com> For __block variables, cache the LLVM types as well as which LLVM field where the variable is stored.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6e319f6adc2a06c31cf99265854eef1321bcecf2 12-Sep-2009 Mike Stump <mrs@apple.com> Add basic covariant thunk generation support. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0ff8bafde95f6fa51ccea70738c1b99db870bddc 11-Sep-2009 Anders Carlsson <andersca@mac.com> Pass GlobalDecls to GenerateCode and StartFunction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0aebc81e02397a5987aaa8e8c7acbdb01a31d7c3 09-Sep-2009 Anders Carlsson <andersca@mac.com> If a cast expression needs either a conversion function or a constructor to be called, generate implicit child expressions that call them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
9ad5513b0f9d3999705659fb1aeb0e6c53455f43 09-Sep-2009 Anders Carlsson <andersca@mac.com> Make BuildByRefType take a ValueDecl instead of a QualType and an alignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
77ca8f6c5e666ef873066b580bf1b7fabd41d4f5 05-Sep-2009 Mike Stump <mrs@apple.com> Install thunks later to fixup overrides. Track space taken by vbase
offsets better for thunk refinements. Cleanups. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ed032eb5c18b99528cbd76415337b6056a72b911 04-Sep-2009 Mike Stump <mrs@apple.com> Add overidding for methods for vtable building for the secondary
vtables. Add thunk generation. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
08c321380fff07d476a19daab6d29522c046cd49 31-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Re-implemented generation of objc_memmove_collectable
API for copying GC'able aggregates (Next runtime only).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
64e690ecf7ba7ad560b0af631bb6f323c38f6da4 27-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen for type convesion of class objects. WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f0070dbae9535836ad41711081465dec2259786b 26-Aug-2009 Mike Stump <mrs@apple.com> Implement virtual dispatch. :-) This is self-consistent with clang,
but not yet necessarily perfectly consistent with gcc. Also addressed
Doug and John's comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
eb1a1b6df0ba8d6d42e16f056cf54a2c87780ffe 26-Aug-2009 Anders Carlsson <andersca@mac.com> Revert r80064 since it broke the build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
78e7d3af10c861678127dc9befe5dcdef5d1baea 26-Aug-2009 Mike Stump <mrs@apple.com> Implement virtual dispatch. :-) This is self-consistent with clang, but not yet
necessarily perfectly consistent with gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2d82719c580f878e0810d868b366a3ac2d00746f 24-Aug-2009 Anders Carlsson <andersca@mac.com> Remove dead code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c28bbc2d2271aab6c5d79ef2758604221cd92a4b 22-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to ir-gen copy assigning array members when synthesizing
a copy assignment operator function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
eb0b6d556ff2b4a5053e89fd084eb34e44cea14c 21-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to provide ir-gen support in copying array members
when synthesizing a copy constructor. Arrays's base element
may have a trivial or non-trivial copy constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f800f6c09ed4a71bcb593d6962e0fda2c2845a70 20-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen patch to destruct array members. WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
09105f52b1f28cbb1374c27c3c70f5517e2c465d 20-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
288dcaf329c49b01dacd5c1dd9f35609555feecd 19-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen for constructing arrays as non-static data members. WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b3d8837214e7346f11e70fecb323f552a259840b 18-Aug-2009 Mike Stump <mrs@apple.com> Add some documentation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
32f3701853a8237704065c77abc17369dd02c39b 18-Aug-2009 Mike Stump <mrs@apple.com> Cleanups. Move GenerateRtti to CodeGenModule.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
109b13db3391face0b393c730f0326ca51d25b52 18-Aug-2009 Mike Stump <mrs@apple.com> Move the rest of the vtable building code into the new builder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
154440e6a8fa6ac5bca395876d79b530b39a2c1c 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0880bacf8fdb7de9d9c5b53b81ea0e53afccafb5 17-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to 1) synthesizing non-trivial default destructor when
one is not provided by user. 2) More complete
emission of ctor prologue when it has no initializer
list or when it is synthesized.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
60e282cc1e508be327b0481cecedc206873cb86a 16-Aug-2009 Anders Carlsson <andersca@mac.com> Improve handling of delete expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
14c5cbf59cffee52275230922283a247de407712 16-Aug-2009 Anders Carlsson <andersca@mac.com> Add an IsInitializer flag to EmitAnyExpr. This is used to prevent temporaries from being destroyed when they're bound to a reference variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
276b9f1d814f4f6551cc3000590759a34185d6da 16-Aug-2009 Mike Stump <mrs@apple.com> Cleanups and fixups for calculating the virtual base offsets. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bbed6b964414145b29e7b60b3e538093734ea3f8 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4721: adjust CodeGen and ASTContext so that we have a
consistent model for handling size expressions for VLAs.

The model is essentially as follows: VLA types own their associated
expression. In some cases, we need to create multiple VLA types to
represent a given VLA (for canonical types, or qualifiers on array types,
or type merging). If we need to create multiple types based off of
the same VLA declaration, we use the new refcounting functionality so they can
all own the expression. The VLASizeMap in CodeGenFunction then uses the size
expression to identify the group of VLA types based off of the same original
declaration.

I'm not particularly attached to the VLA types owning the expression,
but we're stuck with at least until someone comes up with a way
to walk the VLA expressions for a declaration.

I did the parallel fix in ASTContext for DependentSizedArrayType, but I
haven't really looked closely at it, so there might still be issues
there.

I'll clean up the code duplication in ASTContext in a followup commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4ef980984fd0e131fca3f9e6ba15e8a79cabf88c 14-Aug-2009 Mike Stump <mrs@apple.com> Refine vtable layout for virtual bases and keep better track of
primaries. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
0270b8aa3f9b50ec3acd1abfd2b97377a3e1bb05 13-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> More toward synthesizing copy assignments. SWIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4c3aedd3f1fff57d1906b0cdfa7a9ec81a361b2d 13-Aug-2009 Mike Stump <mrs@apple.com> Refactor. WIP. Eventually, this will all go into a vtable builder class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bc16aeab78748cca01a9d84fff71dd1109633ecd 13-Aug-2009 Mike Stump <mrs@apple.com> Refactor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78854 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2198ba12b73a8e6801d13f25de38031da6df46b6 12-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for synthesizing copy assignment operator.
WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4ffe91eae351d6ef68256ce77fc549557702d3e3 12-Aug-2009 Mike Stump <mrs@apple.com> Refine vtable building for the secondary vtables to exclude yet more
cases where a virtual base was already used as a primary base class.
WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f21efe9088a0b3eda1209d1706529f6cb2073092 11-Aug-2009 Benjamin Kramer <benny.kra@googlemail.com> LLVMContext is a class now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
06f598aa45b651f9f3be0b916d43876eae747af0 10-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> minor refactoring. No change otherwise.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
942f4f33d02dba823594bd2d7b3d317cb01c74f8 09-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen for initialization, in synthesize copy constructor,
of base/field which have trivial copy constructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
89ed31d3f9eeb8ec77c284a5cf404a74bf5e7acf 09-Aug-2009 Anders Carlsson <andersca@mac.com> Add support for global initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3b2e16b3d25f6b311dba2871e2a566c96238c3d2 08-Aug-2009 Anders Carlsson <andersca@mac.com> Refactor some code and implement support for global destructors for static variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8c241a2844428eb1589c7b77fc6c1888295a2045 08-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Refactoring of copy ctor ir-gen. No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ca28361fb0a72c50e0a400fae2fad9520e61c0a5 08-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Synthesized copy constructor now generates code for
copying non-virtual base classes which have non-trivial
constructor. Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
97a937532c24a8ea44317d4fdee26d9701a1e83c 07-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> More synthesis of copy constructors. Work in progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
02cf1e264719b4dada4377cc8a43888cb66f8815 07-Aug-2009 Mike Stump <mrs@apple.com> Add support for vcall generation for vtables for virtual bases. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e1be2b16a3a24acda0b63c3dcb4ae3384fcdaf75 06-Aug-2009 Mike Stump <mrs@apple.com> Also generate the rtti field for virtual bases for vtables. Turn on
rtti so we can properly test it. Refactor code a little. Still a
work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78343 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8a12b564923a72224730a467007e61b5701e4aa7 06-Aug-2009 Mike Stump <mrs@apple.com> More layout for virtual tables for virtual bases. Still in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
738f8c278da5950d0d4607de2debe0bdfad64185 01-Aug-2009 Mike Stump <mrs@apple.com> Add beginnigs of rtti generation, wire up more of -fno-exceptions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f121677b6bbbf4e4a51ee7a1120b77adf187bad4 31-Jul-2009 Mike Stump <mrs@apple.com> Add code to setup the vtable pointer in the constructor. Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
426cc3828ce07a2cff15c9837f5958e6fc4b7739 30-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for future ir-gen for destructor calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6d0bdaa68989bee60c85274e82a8f9c982587f26 28-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Some code cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9e809e7da2448c08aa11f15be4680226754678ce 28-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> More work toward data member access ir-gen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77332 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ab3c0a2c879569bb00fa664ebaccf9442c0a9c5f 21-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Early ir-gen for constructor prologue. This is on going.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76493 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d286f05f1234bac289173f0eed88d7ecbaea0099 19-Jul-2009 Daniel Dunbar <daniel@zuster.org> Avoid generation of dead code in a few more situations.
- Emit variable declarations as "simple", we want to avoid forcing the creation
of a dummy basic block, but still need to make the variable available for
later use.

- With that, we can now skip IRgen for other unreachable statements (which
don't define a label).

- Anders, I added two fixmes on calls to EmitVLASize, can you check them?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
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/CodeGenFunction.h
082b02e8403d3ee9d2ded969fbe0e5d472f04cd8 08-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Implemented memmove_collectable API for Next runtime
when struct variables with GC'able members are copied into.
Will provide a test case later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1d8475067d5b62ed5a57ba93862e23f3096a8bdd 04-Jun-2009 Anders Carlsson <andersca@mac.com> Add PushConditionalTempDestruction/PopConditionalTempDestruction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f4b8fea84a6b1ef74cf8fe572918439e34935e51 03-Jun-2009 Anders Carlsson <andersca@mac.com> More temporary work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e8b5578fcc2a3ffb90986f95f2c9127a9a08e34b 03-Jun-2009 Anders Carlsson <andersca@mac.com> Store more information about live temporaries. No functionality change for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a00703dccbdc6cc4a293db38477dea7db5538c7e 31-May-2009 Anders Carlsson <andersca@mac.com> Add a new function for emitting new functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
543ac0c4d24a81fb2b7b6e83370aa8e4cbc93054 31-May-2009 Anders Carlsson <andersca@mac.com> Emit destructors correctly for temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e61c9e80a108b5db7e5f0e702f0e455d737c6390 31-May-2009 Anders Carlsson <andersca@mac.com> Add lvalue irgen support for CXXBindTemporaryExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b58d017f2b9eeed33f2ab3ede968b89cf5296bf2 31-May-2009 Anders Carlsson <andersca@mac.com> More temporary support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7267c1693abe7875b0c57268be05005ae013c6c9 29-May-2009 Anders Carlsson <andersca@mac.com> Add code for emitting C++ destructors. Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7f79f9be5916c51c35da4f126b7c12596a101607 29-May-2009 Mike Stump <mrs@apple.com> Fixup the rest of the trivial cases of the codegen of volatile. If
any body can spot codegen bugs with volatile, or knows of any in the
bug database, let me know.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72572 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0f294632f36459174199b77699e339715244b5ab 27-May-2009 Anders Carlsson <andersca@mac.com> Handle operator call expressions where the callee is a member function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
986477149db76e6d9f8d3c9859c9880c11b680ae 27-May-2009 Anders Carlsson <andersca@mac.com> Rename an EmitCallExpr function to EmitCall to make it clear that it doesn't emit an expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
49d1cd5a09ed3df353371fd7f206674a85e0fb45 27-May-2009 Mike Stump <mrs@apple.com> Fixup codegen for volatile structs in the trivial cases (a a=a and a=a=a).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
27fe2e6c97a3782a0639d87b460741e8ba5d076d 24-May-2009 Mike Stump <mrs@apple.com> Track volatile aggregate copies better. I'm hoping someone else will decide
how to get the backend to know that the operation is volatile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72348 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4029ca7ae9d3ffd7738fe2ed8782bebc30f36fd6 20-May-2009 Anders Carlsson <andersca@mac.com> Add EmitReferenceBindingToExpr. Have EmitCallArg use it for now. Doesn't support anything but at least we don't crash ;)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b4aa4664ec851573624a7a29c6c750fc1d5cc268 19-May-2009 Anders Carlsson <andersca@mac.com> Pass the destination QualType to EmitStoreOfScalar. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b9de2c55b2a33776e2bee8ee57df7599b374c8a5 12-May-2009 Anders Carlsson <andersca@mac.com> Factor code that's common to EmitCXXMemberCallExpr and EmitCXXConstructorCall out into a EmitCXXMemberCall function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b84e8a670ad1d00c0a34295c42ac700cdde04815 04-May-2009 Daniel Dunbar <daniel@zuster.org> Remove unnecessary copy of constraint info.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
31ccf377f4a676eb6c205b47eef435de616d5e2d 03-May-2009 Anders Carlsson <andersca@mac.com> Make codegen for constructors work again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
16f0049415ec596504891259e2a83e19871c0d52 26-Apr-2009 Chris Lattner <sabre@nondot.org> split ObjC and C++ Statements out into their own headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
654599454c8e6cc83b1b9b3af43c49c2f66a26cb 25-Apr-2009 Chris Lattner <sabre@nondot.org> fix PR4067: [Linux kernel] cannot aggregate codegen stmtexpr as lvalue


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b5437d238752dc297e42410e98d38d5250fe0463 23-Apr-2009 Chris Lattner <sabre@nondot.org> the logic for computing __func__ and friends is really broken:
the type assigned by sema (and is visible with sizeof(__func__) for
example) has nothing to do with what codegen ends up producing.
We should eventually add a method on PredefinedExpr to handle this.
In the meantime, just set up some framework and add some fixme's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2a03192a02dbf4fdff438d1e658356bde871aba4 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Make ObjCInterfaceDecl's const in some more places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
525c9b7baeeff022127cd1b167579f3bda73b3ed 21-Apr-2009 Daniel Dunbar <daniel@zuster.org> Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1768fabfbae60202ba497b98dd9be9eb09bb2e20 19-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Silence gcc warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
af23f69aa6247e6bd20a66b2e16babb91f192535 18-Apr-2009 Anders Carlsson <andersca@mac.com> Make CodeGenFunction::EmitCallArgs a template function that takes a generic "Type Info" parameter. The type info parameter knows how to iterate over its arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b14095aa98c6fedd3625920c4ce834bcaf24d9f7 17-Apr-2009 Anders Carlsson <andersca@mac.com> Implement basic code generation of constructor calls. We can now compile:

struct S {
S(int, int);
};

void f() {
S s(10, 10);
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5f4307b7ba164b03c853c8d3eb4674d33f8967a6 14-Apr-2009 Anders Carlsson <andersca@mac.com> Support code generation of 'this' exprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a6cd009e17e21ce7fc84c7c510d190ab1ff69070 11-Apr-2009 Anders Carlsson <andersca@mac.com> Remove asserts that weren't really useful, and that would fire in case the CleanupEntries vector needed to be reallocated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0139bb96494b4c4ba0824617d5d2495dc7e44c76 08-Apr-2009 Anders Carlsson <andersca@mac.com> Add code for emitting call arguments (not used yet).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2b77ba8bc7a842829ad9193816dc1d7d5e9c5be6 04-Apr-2009 Anders Carlsson <andersca@mac.com> Add some basic support for generating C++ member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
774e7c6881ee6cb970cd42239d700dce87ed402a 04-Apr-2009 Anders Carlsson <andersca@mac.com> Add support for calling C++ member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
aa5bd87f1fd5f9ca47924248817c89325759b30e 01-Apr-2009 Daniel Dunbar <daniel@zuster.org> Fix a subtle bug where the cleanup scope entries had a dangling block reference
- <rdar://problem/6732143> Crash when generating @synchronize for
zero-cost exception

- Thanks to Anders for helping track down the problem.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
481769b5dc102b0256b35581e787909ad5edfab5 01-Apr-2009 Chris Lattner <sabre@nondot.org> remove some obsolete comments, use an AssertingVH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a803b0e6ca0d1c71a0b3f5d7380da8bbacf2f983 25-Mar-2009 Mike Stump <mrs@apple.com> Fixup codegen for block literals that bleed copy/dispose information
from previous block literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9034558f2f9ac1dc6bd2e74f4481ca62fce28718 24-Mar-2009 Daniel Dunbar <daniel@zuster.org> Support member reference on ?: of struct type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6cc88f78fd36d3511b89412b193494b3e423cbff 20-Mar-2009 Mike Stump <mrs@apple.com> Fix codegen for support for super inside block literal expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f469557743f77918d2ca8226e2ee2888998ffd4a 20-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> More super dot-syntax property implementation
when there is actually a property declaration
used in the dot-syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
75dfedaf702822c9e51a4f3c5d3ecf2d2ad99272 18-Mar-2009 Chris Lattner <sabre@nondot.org> add codegen support for casting an element to a union.
There are some more complex cases (_Complex and structs)
that I'm still working on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7f28a9c37e67ae16396042ad9c085830969daf29 14-Mar-2009 Mike Stump <mrs@apple.com> Do up codegen for function static data and externs in functions in block
literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0892099dbc640720400a1d9decd2733a09d733e5 07-Mar-2009 Mike Stump <mrs@apple.com> Codegen support for copy helpers for block literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
cf62d39bc2f09855c6ab08bdc5d0bf54067f0041 06-Mar-2009 Mike Stump <mrs@apple.com> Pass the type of the block literal around to make required temporal ordering of code clearer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
00470a1c4c44c5ed26bad9a38b4d3904b02d7a28 05-Mar-2009 Mike Stump <mrs@apple.com> prep work for copy/destroy helpers for block literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ad75ab414ecdddd193d6f2f0e798e85ad5a07242 04-Mar-2009 Mike Stump <mrs@apple.com> Move more blocks CodeGenFunction code up and out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3947de5edda7e0c32060c568cc5f7b2aae6f70b4 04-Mar-2009 Mike Stump <mrs@apple.com> Move some of the CodeGenFunction blocks code up and out. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2a998148a6823c44d67da347c95eb2ea21f6b986 04-Mar-2009 Mike Stump <mrs@apple.com> Move more of blocks codegen out of CodeGenModule and into the
BlockModule. No functionality change. This should help people that
don't want to know anything about blocks not be confused by the
overloaded use of the term block or nor want to see all the blocks
goop.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
96bd13ae1ab89f5a04b3ad3ec8ec1864cbba3482 04-Mar-2009 Mike Stump <mrs@apple.com> Start the migration of more of the blocks code out of sight for most
people. De-duplicates BLOCK_NEEDS_FREE and friends.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
dab514fc30242c7afd6c03956e46136c400fb0d3 04-Mar-2009 Mike Stump <mrs@apple.com> Improved ABI compliance for __block variables. No testcases yet as we
still give an unsupported error for them due to the fact this is a
work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
161d36de7ee686b09525bb919ad1b20592e499fc 28-Feb-2009 Chris Lattner <sabre@nondot.org> improve compatibility with the VC++'08 C++ compiler. Patch by
Niklas Larsson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a99038c0757a836c6faeeddaa5dfd249b32f6e9e 28-Feb-2009 Mike Stump <mrs@apple.com> First cut CodeGen support for __block variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
72564e73277e29f6db3305d1f27ba408abb7ed88 27-Feb-2009 Douglas Gregor <dgregor@apple.com> Create a new TypeNodes.def file that enumerates all of the types,
giving them rough classifications (normal types, never-canonical
types, always-dependent types, abstract type representations) and
making it far easier to make sure that we've hit all of the cases when
decoding types.

Switched some switch() statements on the type class over to using this
mechanism, and filtering out those things we don't care about. For
example, CodeGen should never see always-dependent or non-canonical
types, while debug info generation should never see always-dependent
types. More switch() statements on the type class need to be moved
over to using this approach, so that we'll get warnings when we add a
new type then fail to account for it somewhere in the compiler.

As part of this, some types have been renamed:

TypeOfExpr -> TypeOfExprType
FunctionTypeProto -> FunctionProtoType
FunctionTypeNoProto -> FunctionNoProtoType

There shouldn't be any functionality change...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8958891f5fa1e593c4519a36b3df427ee019d70b 26-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add Type::hasPointerRepresentation predicate.
- For types whose native representation is a pointer.

- Use to replace ExprConstant.cpp:HasPointerEvalType,
CodeGenFunction::isObjCPointerType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
a985b31fc36aa22859983b4a5e7385796c627bdc 25-Feb-2009 Daniel Dunbar <daniel@zuster.org> Fold GeneraticStaticBlockVarDecl into callers.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0096acf421c4609ce7f43e8b05f8c5ca866d4611 25-Feb-2009 Daniel Dunbar <daniel@zuster.org> Pull COdeGenFunction::CreateStaticBlockVarDecl (just for creating the
global variable) out of GenerateStaticBlockVarDecl.
- No intended functionality change.
- Prep for some mild cleanups and PR3662.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
8a219ceda2b5afd447e7199b9c53079bead31b89 24-Feb-2009 Anders Carlsson <andersca@mac.com> Prevent accidental copying of CodeGenFunction and CodeGenModule.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9834ffbe54788239c8361d3cfe5826fd277ddfb2 23-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add low level support for generating invoke instead of calls.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6eef49819da450de398dcbe008066ccc9546ee31 22-Feb-2009 Mike Stump <mrs@apple.com> Copy some clenaups from Eli to code that I copied. :-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
20733cd4fd5c9755cdfab583db862223c93732c8 22-Feb-2009 Mike Stump <mrs@apple.com> Cleanp code with some recent suggestions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4e7a1f7682d94811bd41fca8aefccc38f686db23 21-Feb-2009 Mike Stump <mrs@apple.com> Add CodeGen support for the helper for BlockDeclRefExprs. The easier
stuff is mostly done. Move BlockHasCopyDispose up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c0ef9f59937c3971c48b6fed37cf5bd8985c024b 20-Feb-2009 Daniel Dunbar <daniel@zuster.org> Set call attribute for direct calls (i.e. noreturn).
- Remove an unused variant of EmitCallExpr overload.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
da5c86f097645c3818faf14f99fc3cf23bbf054c 20-Feb-2009 Mike Stump <mrs@apple.com> Deox and Capitolize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
09429b962811f2c0a7a81a1b0a89f96f5878b20c 17-Feb-2009 Mike Stump <mrs@apple.com> Fixup spacing a little.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ef2abfee3ea16ec74942dc09e9e425f46aeb2582 16-Feb-2009 Daniel Dunbar <daniel@zuster.org> Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow.

- Define pow[lf]?, sqrt[lf]? as builtins.

- Add -fmath-errno option which binds to LangOptions.MathErrno

- Add new builtin flag Builtin::Context::isConstWithoutErrno for
functions which can be marked as const if errno isn't respected for
math functions. Sema automatically marks these functions as const
when they are defined, if MathErrno=0.

- IRgen uses const attribute on sqrt and pow library functions to
decide if it can use the llvm intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
30395dd7b77ec1abfae9ebfcacf86f5d72b91fef 14-Feb-2009 Mike Stump <mrs@apple.com> Use getNameAsCString instead of getNameAsString and reflow the type.
Thanks Anders.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
e5fee25e71266712522cff554f25c59b3078a429 13-Feb-2009 Mike Stump <mrs@apple.com> Condense all the blocks code into CGBlocks.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e896d98548b02223c7740d807a0aa6e20fba7079 13-Feb-2009 Anders Carlsson <andersca@mac.com> Add CodeGen support for the nodebug attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
acfde805d644bc71dfeac54ddbc9f12cdae0bb02 12-Feb-2009 Anders Carlsson <andersca@mac.com> Add support for generating block call expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5b5c9ef865607e179413462dcd71bcebb5b7daae 11-Feb-2009 Daniel Dunbar <daniel@zuster.org> Support IRgen of va_arg of structure as l-value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
fa1f756f88f4e6f3da2673082fdc1e8f54bccd6f 10-Feb-2009 Anders Carlsson <andersca@mac.com> Remove the last remnants of the Obj-C EH stack code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e4b6d342c29d5cb9d311756100df1603810fa892 10-Feb-2009 Anders Carlsson <andersca@mac.com> Start removing the old Obj-C EH stack now that the cleanup stack is used instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9d9cc874bcc168474757a8f90476684b4a93ed76 10-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add util Emit{LoadOf,StoreTo}Scalar methods to encapsulate conversion
from LLVM memory type to/from LLVM temporary type.
- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4cc1a4703363ff940b6273aeef9d96a87edeb04b 09-Feb-2009 Anders Carlsson <andersca@mac.com> Add DidCallStackSave variable to CodeGenFunction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0dd9e88aa972d80025c66fb3d7df0266b44cad1a 09-Feb-2009 Mike Stump <mrs@apple.com> Add some more documentation. Also reflowed comments to 80 col.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
48de1012a2d8525362b417efce6fbfdf1c2b36e1 08-Feb-2009 Anders Carlsson <andersca@mac.com> Add a simplified EmitJumpThroughFinally and use it in CGObjC in preparation of making it use the cleanup stack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ec9771d57f94cc204491b3174e88069d08cdd684 08-Feb-2009 Mike Stump <mrs@apple.com> Wire up break and continue processing to the new stack depth adjuster.
If people could beat on it and let me know if there are any new
semantics required by newer language standards or DRs or any little
details I goofed on, I'd be happy to fix any issues found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bb66f9f2e454135b86462d121629275b6ac38e96 08-Feb-2009 Anders Carlsson <andersca@mac.com> More cleanup stack work, PopCleanupBlock now returns a struct with the switch block and end block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d66a9f9019c00d889990c947e16a8f019aa2c1f8 08-Feb-2009 Anders Carlsson <andersca@mac.com> Split some functions up

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6fc559136b8ef98bfb824a0fd49df385405f2879 08-Feb-2009 Anders Carlsson <andersca@mac.com> CleanupScope needs to push the cleanup block in its destructor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
87eaf17cc88516277e4389dfa15df93ecfdce559 08-Feb-2009 Anders Carlsson <andersca@mac.com> More cleanup stack work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bd6fa3d032acd7eafc6c10827c41103df45beab7 08-Feb-2009 Anders Carlsson <andersca@mac.com> When emitting blocks, keep track of which cleanup scope they have. Minor fixes and cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c71c845fe77ee1f891d60232ec320912d88557ee 08-Feb-2009 Anders Carlsson <andersca@mac.com> Add support for emitting cleanup blocks. Make EmitCompoundStatement emit cleanup blocks if necessary

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64051 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0d5c6851393d260dfb5ab0420b50adc173e1c549 08-Feb-2009 Anders Carlsson <andersca@mac.com> Add a simple RAII object, to be used for pushing a cleanup entry and make the insertion point be the cleanup block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3e9da66ac7e88d64d30ee777588677320660cf84 08-Feb-2009 Mike Stump <mrs@apple.com> Ensure we track all the stack depths for all break and continue points
correctly. This should lay the ground work to throw the big switch
and start code gening break and continue in the presense of vlas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6ccc47698d0311ddabf32fa0f6db8e4f09ac96f8 07-Feb-2009 Anders Carlsson <andersca@mac.com> Add plumbing for the cleanup stack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
273558fbd891a0872e620e0d3d109b92c1160d72 07-Feb-2009 Anders Carlsson <andersca@mac.com> Split the exception object out into its own stack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
190d00e1396214c77539c7095756b9ea38160463 07-Feb-2009 Anders Carlsson <andersca@mac.com> Simplify the Objective-C exception handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
72cac2ccce8058833f56358e3391e28a8ddeeaa4 07-Feb-2009 Mike Stump <mrs@apple.com> Arrange to have the correct StackDepth for while statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
36a2ada69fdb457b0e46d0ef452c150b360d8888 07-Feb-2009 Mike Stump <mrs@apple.com> Fixup goto codegen in and around VLAs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
13e81737a433b23f8c662d10d1d57356122a8caa 05-Feb-2009 Daniel Dunbar <daniel@zuster.org> Pull CodeGenFunction::GetUndefRValue() out of EmitUnsupportedRValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8b1a343b6b360d63d5dc8a6beb841ce4414c1e00 04-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add CodeGenFunction::ConvertTypeForMem forwarding function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
598d3f61b6ca854e9d3c2f3359e24468502a61aa 03-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen for nonfragile ivar bitfield access (objc2 nonfragile abi).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
45206ecf708bf03b04db07c2476b9f862127a8b1 03-Feb-2009 Sanjiv Gupta <sanjiv.gupta@microchip.com> Targets that don't have stack use global address space for parameters.
Specify external linkage for such globals so that llvm optimizer do
not assume there values initialized as zero.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ecb6b0e2c17c47ce06da601a78820940e7c6da73 03-Feb-2009 Sanjiv Gupta <sanjiv.gupta@microchip.com> Fixed the typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
45012a7ef5abf1042c893f3f2fa5c23cb5485ea9 03-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> objc2's ir-gen for nonfragile ivar access.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
88b5396b0897f28d22ae3debf4a0d97b33b6c362 02-Feb-2009 Daniel Dunbar <daniel@zuster.org> More ABI API cleanup.
- Lift CGFunctionInfo creation above ReturnTypeUsesSret and
EmitFunction{Epi,Pro}log.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63553 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
bb36d331f439f49859efcfb4435c61762fbba6f9 02-Feb-2009 Daniel Dunbar <daniel@zuster.org> ABI handling API changes.
- Lift CGFunctionInfo creation up to callers of EmitCall.

- Move isVariadic bit out of CGFunctionInfo, take as argument to
GetFunctionType instead.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1c1d6074f5a0296dd273362655b1b8f9057289e3 27-Jan-2009 Daniel Dunbar <daniel@zuster.org> Pull EmitReturnBlock out of FinishFunction and catch unified return
case correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4fd0aa5803357d8c72eeac2cae15e12649ea08fe 20-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Slight cleanup, and fix for va_arg on architectures where va_list is a
struct.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c8c7b187adcd989e01a9fba1ebead6c2abd770c9 11-Jan-2009 Anders Carlsson <andersca@mac.com> Forgot to commit this

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
679a502d462ef819e6175b58e255ca3f3391e7cf 10-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> This patch fixes the code gen failures which was a fallout from
not merging protocol properties into the classes which
use those protocols. With this patch, all my exceutable
test pass again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ce1d38b8163650e473d7084e0686ed5a7956057b 09-Jan-2009 Daniel Dunbar <daniel@zuster.org> Give "unsupported" error on calls through block pointers instead of
crashes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
60d35413662ebdcd1d31e34a8a7c665eb6977f1e 20-Dec-2008 Anders Carlsson <andersca@mac.com> Change EmitVLASize to take a QualType that must be a variably modified type.

Emit the size even if the declared type is a variably modified type. This lets us handle

void f(int n) {
int (*a)[n];

printf("size: %d\n", sizeof(*a));
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f666b7780d04186521adcaedb0e15dfa4d5e6933 20-Dec-2008 Anders Carlsson <andersca@mac.com> Split up emitting of VLA sizes and getting the size of a VLA.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
fd64bb635dc221baa19f81d5d2a084f7eb269f7f 15-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Code gen. for ivar references; including bitfield
ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e21269bcb732afa70386fdd4c95d22bc2ed943b1 13-Dec-2008 Anders Carlsson <andersca@mac.com> Store the size of the EH stack inside each BreakContinue struct so we know when a break/continue won't cross a try block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
dcc90d87e6430c643b4311ae5b0089535bca41f7 12-Dec-2008 Anders Carlsson <andersca@mac.com> Add map of VLA types and their sizes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
17d28a3e0b0efaba14534d0e6d6a307283d96b9f 12-Dec-2008 Anders Carlsson <andersca@mac.com> Work in preparation for VLAs. Make sure to restore the stack if necessary (Saving the stack isn't implemented right now :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
fef30b55230064d334a669a065a1c9acdb87cdfe 09-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Support for implementation of property in the case where
the synthesis is in an implementation of s subclass of
a super class where the property has been declared.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
43f447098d5e6162fbfb97ed38365284207a7fbe 22-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Implemented ir-gen for 'implicit' properties using the new AST nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5daf570d0ce027e18ed5f9d66e6b2a14a40b720d 22-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> New AST node to access "implicit" setter/getter using property dor syntax.
Issuing diagnostics when assigning to read-only properties.
This is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
80b0b42a09c3de8392f9ba1e24ffcc35355a8dea 20-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Added a test case for __weak field decls. Change SetVarDeclObjCAttribute
to static function. Added comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2682d8b3a0415d521d5ca11afb13a8bc5c559a31 20-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> More objc gc stuff. Read/Write barriers for local static/extern,
diagnostics on use of __weak attribute on fields,
Early support for read/write barriers for objc fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ed3849b456d64d124bddc7ac044f3ce590bd9d69 19-Nov-2008 Daniel Dunbar <daniel@zuster.org> Fix redundant load of bit-fields on assignment (to get the updated
value).
- Use extra argument to EmitStoreThroughLValue to provide place to
write update bit-field value if caller requires it.
- This fixes several FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
10cac6f7115b59a466bb8d2d51cdddeb38aadc37 15-Nov-2008 Chris Lattner <sabre@nondot.org> Start implementing support for @synchonized with the darwin ObjC API.

Patch by Fariborz!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a0c21a8faa79e88ac432d116eca58f7a7217195d 13-Nov-2008 Daniel Dunbar <daniel@zuster.org> Add IsFinished arg to EmitBlock.
- Indicates that caller is done with the block and it can be dropped
if it has no predecessors. Useful for callers who need to make
landing pads but which may not be reached.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4bc0455d826e9634b7a68c0d06146edd633c9453 12-Nov-2008 Daniel Dunbar <daniel@zuster.org> Comment/indentation fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0912425f79418a215c2fbd2d8fc9511244a4aa46 12-Nov-2008 Daniel Dunbar <daniel@zuster.org> IRgen improvements on unreachable code:
- Split out "simple" statements which can easily handle IR generation
when there is no insert point. These are generally statements which
start by emitting a new block or are only containers for other
statements.

- This fixes a regression in emitting dummy blocks, notably for case
statements.

- This also fixes spurious emission of a number of debug stoppoint
intrinsic instructions.

Remove unneeded sw.body block, just clear the insertion point.

Lift out CodeGenFunction::EmitStopPoint which calls into the
CGDebugInfo class when generating debug info.

Normalize definitions of Emit{Break,Continue}Stmt and usage of
ErrorUnsupported.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
31a0984b5cb4af99d2407c0f25bf5af68df681c6 12-Nov-2008 Chris Lattner <sabre@nondot.org> Move EmitBranchOnBoolExpr and ConstantFoldsToSimpleInteger to
CodeGenFunction.cpp. Change VisitConditionalOperator to use
constant fold instead of codegen'ing a constant conditional.

Change ForStmt to use EmitBranchOnBoolExpr, this shrinks
expr.c very slightly to 40239 lines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9bc47e29dce8f095be7a6d07dbb02a5a7a112949 12-Nov-2008 Chris Lattner <sabre@nondot.org> Make emission of 'if' conditions much more sophisticated when we
have a condition that is an &&/||. Before we used to compile things like this:

int test() {
if (x && y) foo(); else bar();
}

into:

%0 = load i32* @x ; <i32> [#uses=1]
%1 = icmp ne i32 %0, 0 ; <i1> [#uses=1]
br i1 %1, label %land_rhs, label %land_cont

land_rhs: ; preds = %entry
%2 = load i32* @y ; <i32> [#uses=1]
%3 = icmp ne i32 %2, 0 ; <i1> [#uses=1]
br label %land_cont

land_cont: ; preds = %land_rhs, %entry
%4 = phi i1 [ false, %entry ], [ %3, %land_rhs ] ; <i1> [#uses=1]
br i1 %4, label %ifthen, label %ifelse

ifthen: ; preds = %land_cont
%call = call i32 (...)* @foo() ; <i32> [#uses=0]
br label %ifend

ifelse: ; preds = %land_cont
%call1 = call i32 (...)* @bar() ; <i32> [#uses=0]
br label %ifend

ifend: ; preds = %ifelse, %ifthen


Now we turn it into the much more svelte code:

%0 = load i32* @x ; <i32> [#uses=1]
%1 = icmp ne i32 %0, 0 ; <i1> [#uses=1]
br i1 %1, label %land_lhs_true, label %ifelse

land_lhs_true: ; preds = %entry
%2 = load i32* @y ; <i32> [#uses=1]
%3 = icmp ne i32 %2, 0 ; <i1> [#uses=1]
br i1 %3, label %ifthen, label %ifelse

ifthen: ; preds = %land_lhs_true
%call = call i32 (...)* @foo() ; <i32> [#uses=0]
br label %ifend

ifelse: ; preds = %land_lhs_true, %entry
%call1 = call i32 (...)* @bar() ; <i32> [#uses=0]
br label %ifend

ifend: ; preds = %ifelse, %ifthen

Note the lack of a phi node.

This shrinks the -O0 .ll file for 176.gcc/expr.c from 43176 to 40267 lines.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
29ea6729155c759836be4b5453bee9ef8e1e97ee 12-Nov-2008 Daniel Dunbar <daniel@zuster.org> Disable generation of basic block names in NDEBUG mode.

Revert to enabling generation of instruction names when not in NDEBUG
mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
a448fb2da03ece39978784793eea68760e8205a1 12-Nov-2008 Daniel Dunbar <daniel@zuster.org> Rework IRgen invariant w.r.t. current insert point.
- EmitStmt is no longer required to finish with a current insertion
point defined (i.e. it does not need to make dummy
blocks). Instead, it can clear the insertion point in the builder
which indicates that the current insertion point is unreachable.
- CodeGenFunction provides HaveInsertPoint and EnsureInsertPoint
which respectively test if there is an insert point and ensure an
insertion point exists (by making a dummy block).
- Clearly mark functions in CodeGenFunction which can be called with
no insertion point defined. Currently this is a limited set, and
EmitStmt simply EnsureInsertPoint()s before emitting subsequent IR.

Remove EmitDummyBlock, which is no longer needed. Clients who haven't
already cleared the insertion point (typically via EmitBranch) can do
so by hand.

Remove isDummyBlock, which has effectively been renamed to
HaveInsertPoint.

The main thrust of this change is that we no longer have create dummy
blocks just to destroy them a short time later in EmitBlock in the
common case that there is no unreachable code following something like
a goto.

Additionally, this means that we are not using the hokey condition in
isDummyBlock that a block without a name is a dummy block. Guess how
well that works when we never emit block names!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5e08ad3cc62ab94649959ae227a9a411a729bf49 11-Nov-2008 Daniel Dunbar <daniel@zuster.org> Change EmitBranch to always clear the insert point to clarify irgen
invariants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d57a871339c7c98d58d93108b806f59bdf4e13e2 11-Nov-2008 Daniel Dunbar <daniel@zuster.org> Add CodeGenFunction::EmitBranch.
- Emits an unconditional branch, with extra logic to avoid generating
spurious branches out of dummy blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0946ccd1e58c1f1da31ddbca67c5b6301ac8b255 11-Nov-2008 Chris Lattner <sabre@nondot.org> short circuit && and || when possible. This substantially reduces
the size of the -O0 output on some cases. For example, on expr.c from
176.gcc, it shrinks the .ll file from 43164 to 42835 lines, and removed
references to two external symbols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
824e3bd76b2e32db2ec6e4d2d113413e518d1c63 11-Nov-2008 Daniel Dunbar <daniel@zuster.org> Add CodeGenFunction::EmitDummyBlock for marking places where we make
"dummy" blocks (blocks just used to make sure we have a place to dump
code to).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
55e874299f2ad827646a4ca9ea38c402aaeb38c9 11-Nov-2008 Daniel Dunbar <daniel@zuster.org> Centralize basic block creation in CodeGenFunction::createBasicBlock.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
cd9b46e5442a3ef17f83f75177d8545cb5b3e2b9 04-Nov-2008 Douglas Gregor <dgregor@apple.com> Add a new expression class, ObjCSuperExpr, to handle the Objective-C 'super'. Remove ObjCThis from PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ddf7cac45d85b73127adbbd91a2b28fc7291c57e 04-Nov-2008 Anders Carlsson <andersca@mac.com> Implement lowering of va_arg in clang directly. (This is 32-bit X86 only for now).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
45d196b8387dcefc4df26cda114fa34c6528e928 01-Nov-2008 Daniel Dunbar <daniel@zuster.org> Move IRBuilder type definition to common file.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2284ac9ec80299fcdefae9a2787cf85105a0f203 18-Oct-2008 Daniel Dunbar <daniel@zuster.org> Debug info bug fix, function start wasn't getting generated correctly
for Obj-C methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
662b71ee82339c67f2c3689196e716c6560cf925 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> Lift CodeGenFunction::EmitPredefinedFunctioName out of EmitPredefinedLValue.
- Shouldn't assume predefined expr is a function printing one.
- Uses CGM functionality to cache function names per module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
f02e9ddf5efc75917af712b3c7f909581205f0a5 10-Oct-2008 Daniel Dunbar <daniel@zuster.org> Lift EmitTargetBuiltinExpr out of EmitBuiltinExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
898d508d4c9e9d45914952473e39196b20830a9f 30-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add infrastructure for proper @finally support.
- Provides a basic primitive to jump to an arbitrary basic block,
through the finally code.

- Only used for return statements and rethrow currently. Still need
to handle break, continue and goto.

- Code still needs to be shuffled around to live elsewhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
18ccc7776ad6288c5f630dc7967fb99d099c9cd9 28-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add support for implicit rethrows in @catch blocks.

Comment exception-handling code generation strategy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
29e0bccf2bcce22b877f8b2ed173f564c116b97e 24-Sep-2008 Daniel Dunbar <daniel@zuster.org> Refactor some CodeGen functionality:
- Add CodeGenFunction::{EmitReturnOfRValue, EmitIvarOffset}
- Factor EmitLValueForIvar out of EmitObjCIvarRefLValue.

No non-error functionality change (some unsupported errors are
degraded to asserts for the time being).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5627377df5439a1d3d46a4e4cef4ae44f84a322b 17-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add support for ABIArgInfo::Expand
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
dde0a94120915fa925d1ffcdb997c7b44dc9fa21 11-Sep-2008 Anders Carlsson <andersca@mac.com> Make sure to store the exception in the catch parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1452f5599d4de1d97a71ad61786126b91da9da69 11-Sep-2008 Anders Carlsson <andersca@mac.com> Make sure to emit the catch parameter as well as the catch body.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e3a09e6ad09f8d1387ecaa008aaf85527909da0a 10-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement CodeGen support for the 'CXXConditionDeclExpr' expression node, which represents a 'condition' declaration, e.g: "if (int x=0) {...}".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b768807c49a1c7085def099b848631856af766fa 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Tweak CGCall functions again:
- Realized these functions will eventually need access to more data,
moved to CodeGenModule. Eventually they should probably live
together in some other helper class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5323a4b0a1c248fa2ffdf886bb41a5d8fba71d2d 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Tweak CGCall functions:
- Move actual param attr list creation to
CodeGenFunction::ConstructParamAttrList.
- Make ReturnTypeUsesSret static.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3913f184c84135fb4612743f1faa6c1edd2dd055 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add CodeGenFunction::ReturnTypeUsesSret
- Hook so NeXT runtime doesn't depend on ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
17b708d61827cd86278e9580b041dd6cbadf07d3 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Move ABI specific code for functions / calls to CGCall.cpp:
- Factor out EmitFunction{Pro,Epi}log


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7c086516f3cc9fba2733b1919973206c6ba4b171 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Factor CodeGenFunction::StartFunction out of GenerateCode and
StartObjCMethod.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5ca2084cf9b529563209429857f01fdae9dcdfa5 09-Sep-2008 Daniel Dunbar <daniel@zuster.org> Use a unified return block.
- For the time being this means our emitted code is somewhat worse,
especially for aggregates. This will be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7482d12c345c6391f8956850545e2d4aa7701ce6 09-Sep-2008 Daniel Dunbar <daniel@zuster.org> Move EmitAggregate{Copy,Clear} into CodeGenFunction.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
64d5d6c5903157c521af496479d06dc26032d718 09-Sep-2008 Anders Carlsson <andersca@mac.com> Move handling of @try and @throw to the runtime class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
46f45b9bec4a265ad8400a538e5ec3a5683617f1 09-Sep-2008 Daniel Dunbar <daniel@zuster.org> Change CodeGen to emit calls using (RValue,Type) list:
- Add CodeGenFunction::EmitAnyExprToTemp
o Like EmitAnyExpr, but emits aggregates to a temporary location if
none is available. Seems like this should be simpler (even aside
from using first class aggregates).

- Killed CodeGenFunction::EmitCallArg (just append the pair)

- Conversion of RValues to actual call arguments is now isolated in
CodeGenFunction::EmitCall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0dbe227feccf6a8dbadfff8ca3f80416b7bf2f28 08-Sep-2008 Daniel Dunbar <daniel@zuster.org> Refactor parameter attribute handling:
- Add CGCall.h for dealing with ABI issues related to calls.
- Add CGFunctionInfo and CGCallInfo for capturing ABI relevant
information about functions and calls.
- Isolate LLVM parameter attribute handling inside CGCall.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
90df4b6661968a84bf64baee489bb2f6d948fcc1 04-Sep-2008 Daniel Dunbar <daniel@zuster.org> Avoid superfluous errors regarding variable-length arrays (casts).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
80e62c29fe21cd06c93eba6e72b7e32dca06fcf9 04-Sep-2008 Daniel Dunbar <daniel@zuster.org> Implement codegen of aggregates as lvalues in binary expressions,
e.g. "(a = b).somefield".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
3d8400d9a61aa4b63ff35e5cede405b32a41425e 30-Aug-2008 Anders Carlsson <andersca@mac.com> Stub out CodeGenFunction::EmitObjCForCollectionStmt.

Add CodeGenFunction::EmitMemSetToZero and make AggExprEmitter::EmitAggregateClear use it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
7f8ea5c5b3a6a4332a841eefdd86b0726722ea7b 30-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add Objective-C property setter support.
- Change Obj-C runtime message API, drop the ObjCMessageExpr arg in
favor of just result type and selector. Necessary so it can be
reused in situations where we don't want to cons up an
ObjCMessageExpr.
- Update aggregate binary assignment to know about special property
ref lvalues.
- Add CodeGenFunction::EmitCallArg overload which takes an already
emitted rvalue.

Add CodeGenFunction::StoreComplexIntoAddr.

Disabled logic in Sema for parsing Objective-C dot-syntax that
accesses methods. This code does not search in the correct order and
the AST node has no way of properly representing its results.

Updated StmtDumper to print a bit more information about
ObjCPropertyRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
19cd87eb5fb3c197e631ce08fd52c446c4d4e8f1 30-Aug-2008 Daniel Dunbar <daniel@zuster.org> Refactor handling of calls:
- Added CodeGenFunction::EmitCall which just takes the callee, return
type, and a list of (Value*,QualType) pairs.
- Added CodeGenFunction::EmitCallArg which handles emitting code for
a call argument and turning it into an appropriate
(Value*,QualType) pair.
- Changed Objective-C runtime interface so that the actual emission
of arguments for message sends is (once again) done in the code to
emit a message send.

No intended functionality change, this is prep work for better ABI
support and for Objective-C property setter support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55560 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
662174c82ef46b19a2329c7d37208e1d12dfb7b3 29-Aug-2008 Daniel Dunbar <daniel@zuster.org> Downgrade a number of FIXME asserts to ErrorUnsupported.
- Notably VLAs


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
85c59edda02df48fae8dc85049743319bc6e7e89 29-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add special "property reference" CodeGen::LValue type for emitting
Objective-C property references.
- This handles property references "more correctly" but setters still
don't work.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
9c3fc703b29a31d40bcf5027dbb4784dd393804e 27-Aug-2008 Daniel Dunbar <daniel@zuster.org> Initial support for Obj-C dot-syntax for getters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
af05bb9073319d8381b71c4325188853fd4b8ed6 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Objective-C @synthesize support.
- Only supports simple assignment and atomic semantics are ignored.
- Not quite usable yet because the methods do not actually get added
to the class metadata.
- Added ObjCPropertyDecl::getSetterKind (one of Assign, Copy, Retain).
- Rearrange CodeGenFunction so synthesis can reuse function prolog /
epilog code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
6ba82a4a4b295e54cf192c3e98b28f39990c6194 25-Aug-2008 Daniel Dunbar <daniel@zuster.org> Support __PRETTY_FUNCTION__ and friends in Obj-C methods.

Add CodeGenFunction::EmitUnsupportedLValue
- Gives error and returns undef value.

Swap some asserts() over to using EmitUnsupportedLValue
- Rumor has it users (and even some developers) prefer carat
diagnostics to backtraces.
- Works better in Release-Asserts to boot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0a04d77bde7e3a661c2b41b60630d125d09ed6ef 23-Aug-2008 Daniel Dunbar <daniel@zuster.org> Implement Obj-C ivar references to aggregates.

Implement Obj-C lvalue message sends (aggregate returns).

Update several places to emit more precise ErrorUnsupported warnings
for currently unimplemented Obj-C features (main missing chunks are
property references, Obj-C exception handling, and the for ... in
syntax).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8f2926b73ed635afecd020da787af6a837601a2b 23-Aug-2008 Daniel Dunbar <daniel@zuster.org> Trim CGObjCRuntime::GenerateMessageSend[Super]
- Returns an RValue.
- Reduced to only taking the CodeGenFunction, Expr, and Receiver.
- Becomes responsible for emitting the arguments.

Add CodeGenFunction::EmitCallExprExt
- Takes optional extra arguments to insert at the head of the call.
- This allows the Obj-C runtimes to call into this and isolates the
argument and call instruction generation code to one place. Upshot
is that we now pass structures (more) correctly.

Also, fix one aspect of generating methods which take structure
arguments (for NeXT). This probably needs to be merged with the
SetFunctionAttributes code in CodeGenModule.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2eecaab0fa5f569c3de82a7f04c5dc39298f472d 23-Aug-2008 Daniel Dunbar <daniel@zuster.org> Move [LR]Value into CGValue.h
- No (intended) functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
e1b29efab32d02e114046d33cca242a88585bf8a 22-Aug-2008 Anders Carlsson <andersca@mac.com> Add preliminary (and probably broken) codegen support for C++ static initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
ed7c618f849e2541b1d0288c43154937652c5b15 20-Aug-2008 Daniel Dunbar <daniel@zuster.org> Move all Obj-C runtime interaction into CodeGenFunction.
- Drop duplicate (and broken) code for sending messages.
- Add EmitObjCProtocolExpr to CodeGenFunction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
b7ec246872b412f0e7bb9e93eacfd78cfa6adfb3 16-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add NeXT runtime support for generating methods.

Change CodeGenFunction::EmitParmDecl to take either a ParmVarDecl or an
ImplicitParamDecl.

Drop hasAggregateLLVMType from CodeGenModule.cpp (use version in
CodeGenFunction).

Change the Objective-C method generation to use EmitParmDecl for
implicit parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
c4a1dea2dc56bd1357ec91b829a0b9e68229a13e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
- Moved Sema::getCurMethodDecl() out of line (dependent on
ObjCMethodDecl via dyn_cast).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
d9f6910f4ef37c0e8eeee2a01287d9572c3176ef 10-Aug-2008 Chris Lattner <sabre@nondot.org> rename PreDefinedExpr -> PredefinedExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
85e356825b291f86c6e926638914222b834b71a3 08-Aug-2008 Chris Lattner <sabre@nondot.org> update to make IRBuilder API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
0ffb125996336fc7602b162c0a9e392f1a93060f 04-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add CodeGen support for indirect goto.
- Follows emission scheme used by llvm-gcc, i.e. invent an id for
each label whose address is taken and replace each indirect goto by
a switch to each possible target.
- Currently we emit a switch for each indirect goto instead of
merging them as llvm-gcc does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
91d723da7b68be5245c3ac58aa2a36d04658cfb8 26-Jul-2008 Chris Lattner <sabre@nondot.org> implement codegen support for labels at the end of stmtexprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
69ce1dff4a1f86d5bd7135c0491fd628d2d76cc7 25-Jul-2008 Nate Begeman <natebegeman@mac.com> Move comment to match style


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8fdf32822be2238aa7db62d40e75b168b637ab7d 24-Jun-2008 Chris Lattner <sabre@nondot.org> "Support for Objective-C message sends which return structures. Also includes a small fix for constant string handling that should have been in the last patch (sorry!) and a hook for generating selectors (rest of this implementation to follow in the next patch)."

Patch by David Chisnall!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4111024be81e7c0525e42dadcc126d27e5bf2425 17-Jun-2008 Chris Lattner <sabre@nondot.org> Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.
Patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
5549976193e34417d4474a5f4a514268ef6666c7 17-Jun-2008 Ted Kremenek <kremenek@apple.com> This patch is motivated by numerous strict-aliasing warnings when compiling
clang as a Release build.

The big change is that all AST nodes (subclasses of Stmt) whose children are
Expr* store their children as Stmt* or arrays of Stmt*. This is to remove
strict-aliasing warnings when using StmtIterator. None of the interfaces of any
of the classes have changed (except those with arg_iterators, see below), as the
accessor methods introduce the needed casts (via cast<>). While this extra
casting may seem cumbersome, it actually adds some important sanity checks
throughout the codebase, as clients using StmtIterator can potentially overwrite
children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts
provide extra sanity checks that are operational in debug builds to catch
invariant violations such as these.

For classes that have arg_iterators (e.g., CallExpr), the definition of
arg_iterator has been replaced. Instead of it being Expr**, it is an actual
class (called ExprIterator) that wraps a Stmt**, and provides the necessary
operators for iteration. The nice thing about this class is that it also uses
cast<> to type-checking, which introduces extra sanity checks throughout the
codebase that are useful for debugging.

A few of the CodeGen functions that use arg_iterator (especially from
OverloadExpr) have been modified to take begin and end iterators instead of a
base Expr** and the number of arguments. This matches more with the abstraction
of iteration. This still needs to be cleaned up a little bit, as clients expect
that ExprIterator is a RandomAccessIterator (which we may or may not wish to
allow for efficiency of representation).

This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c,
which was already broken) on both a Debug and Release build, but it should
obviously be reviewed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
1e692ace08959399794363e77499b73da5494af9 14-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Basic support for volatile loads and stores. Stores the volatile
qualifier in the lvalue, and changes lvalue loads/stores to honor
the volatile flag. Places which need some further attention are marked
with FIXMEs.

Patch by Cédric Venet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
963fcb0737aebe929e58967e60b1c9e7cf9d330e 22-May-2008 Eli Friedman <eli.friedman@gmail.com> Make CurFuncDecl more specific; I have some code I'm going to land in a
bit that wants to use CurFuncDecl as a FunctionDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
4f8d123e3e2c260de3377208106ddba87cee28b4 22-May-2008 Dan Gohman <gohman@apple.com> Move getAccessedFieldNo out of lib/AST/Expr.cpp into
lib/CodeGen/CGExpr.cpp and to change include/clang/AST/Attr.h to
use its own enum for visibility types instead of using
llvm::GlobalValue::VisibilityTypes. These changes eliminate
dependencies in the AST library on LLVM's VMCore library.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
06e863f2902b8ba55b056308875c19f7ba3dab25 14-May-2008 Eli Friedman <eli.friedman@gmail.com> Add codegen support for block-level compound literals.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
8a99764f9b778a54e7440b1ee06a1e48f25d76d8 09-May-2008 Nate Begeman <natebegeman@mac.com> Extend vector member references to include {.hi, .lo, .e, .o} which return a
vector of the same element type and half the width, with the high, low, even,
and odd elements respectively.

Allow member references to member references, so that .hi.hi gives you the high
quarter of a vector. This is fairly convenient syntax for some insert/extract
operations.

Remove some unnecessary methods/types in the ExtVectorElementExpr class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
2621fd1d6d3c5eadcae246859f62738645df7540 08-May-2008 Chris Lattner <sabre@nondot.org> Add basic support for the pic-* target triples and add support for
targets that do not support recursion (and thus codegen stack variables
as globals).

Patch contributed by Alireza Moshtaghi!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50844 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
213541a68a3e137d11d2cefb612c6cdb410d7e8e 19-Apr-2008 Nate Begeman <natebegeman@mac.com> OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
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/CodeGenFunction.h
50b36741673258aaebcd3c7fe1260031901cae57 13-Apr-2008 Chris Lattner <sabre@nondot.org> update to follow mainline llvm API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
c8aa5f1f264fb230c38182adab944232bb160c2b 04-Apr-2008 Chris Lattner <sabre@nondot.org> Codegen assignment to self correctly, patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49201 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.h
391d77a26382dddf25da73e29fc1fa5aaaea4c6f 31-Mar-2008 Chris Lattner <sabre@nondot.org> Add initial support for objc codegen for methods, ivars, and the
etoile runtime, patch by David Chisnall!


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