History log of /external/clang/lib/CodeGen/CodeGenFunction.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4967a710c84587c654b56c828382219c3937dacb 20-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master Clang for rebase to r275480

Bug: http://b/31320715

This merges commit ac9cc4764cf47a6c3f031687d8592e080c9f5001 from
aosp/dev.

Test: Build AOSP and run RenderScript tests (host tests for slang and
libbcc, RsTest, CTS)

Change-Id: Ic2875e5c3673c83448cd7d1013861e42947b1b55
/external/clang/lib/CodeGen/CodeGenFunction.cpp
87d948ecccffea9e9e37d0d053b246e2d6d6c47b 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r256229

http://b/26987366

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

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

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

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

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

Change-Id: Ic557ac55e97fbf6ee08771c7b7c3594777b0aefd
/external/clang/lib/CodeGen/CodeGenFunction.cpp
c568f1e98938584c0ef0b12ae5018ff7d90a4072 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

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

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

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/CodeGen/CodeGenFunction.cpp
3cebc73895daccea85984d8881b5b45c8f8df9c6 05-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y sized deallocation: if we have a use, but not a definition, of a sized
deallocation function (and the corresponding unsized deallocation function has
been declared), emit a weak discardable definition of the function that
forwards to the corresponding unsized deallocation.

This allows a C++ standard library implementation to provide both a sized and
an unsized deallocation function, where the unsized one does not just call the
sized one, for instance by putting both in the same object file within an
archive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
8b54999a831bb195c08541ca995ef0505c96193f 30-Oct-2013 Mark Lacey <mark.lacey@apple.com> Add CodeGenABITypes.h for use in LLDB.

CodeGenABITypes is a wrapper built on top of CodeGenModule that exposes
some of the functionality of CodeGenTypes (held by CodeGenModule),
specifically methods that determine the LLVM types appropriate for
function argument and return values.

I addition to CodeGenABITypes.h, CGFunctionInfo.h is introduced, and the
definitions of ABIArgInfo, RequiredArgs, and CGFunctionInfo are moved
into this new header from the private headers ABIInfo.h and CGCall.h.

Exposing this functionality is one part of making it possible for LLDB
to determine the actual ABI locations of function arguments and return
values, making it possible for it to determine this for any supported
target without hard-coding ABI knowledge in the LLDB code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
b914e87377fd4d7642f544000a79f8648c6f06c9 20-Oct-2013 Peter Collingbourne <peter@pcc.me.uk> Implement function type checker for the undefined behavior sanitizer.

This uses function prefix data to store function type information at the
function pointer.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
4ee7dc2369c1f0257a73b2e83a7d38fdebdd9176 02-Oct-2013 Nick Lewycky <nicholas@mxc.ca> Thread a SourceLocation into the EmitCheck for "load_invalid_value". This occurs
when scalars are loaded / undergo lvalue-to-rvalue conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
fad9e13f3cb85198f0ee5af620ba81cd78574faa 26-Sep-2013 Faisal Vali <faisalv@yahoo.com> Implement a rudimentary form of generic lambdas.

Specifically, the following features are not included in this commit:
- any sort of capturing within generic lambdas
- generic lambdas within template functions and nested
within other generic lambdas
- conversion operator for captureless lambdas
- ensuring all visitors are generic lambda aware
(Although I have gotten some useful feedback on my patches of the above and will be incorporating that as I submit those patches for commit)

As an example of what compiles through this commit:

template <class F1, class F2>
struct overload : F1, F2 {
using F1::operator();
using F2::operator();
overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
};

auto Recursive = [](auto Self, auto h, auto ... rest) {
return 1 + Self(Self, rest...);
};
auto Base = [](auto Self, auto h) {
return 1;
};
overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
int num_params = O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

This patch has been reviewed by Doug and Richard. Minor changes (non-functionality affecting) have been made since both of them formally looked at it, but the changes involve removal of supernumerary return type deduction changes (since they are now redundant, with richard having committed a recent patch to address return type deduction for C++11 lambdas using C++14 semantics).



Some implementation notes:

- Add a new Declarator context => LambdaExprParameterContext to
clang::Declarator to allow the use of 'auto' in declaring generic
lambda parameters

- Add various helpers to CXXRecordDecl to facilitate identifying
and querying a closure class

- LambdaScopeInfo (which maintains the current lambda's Sema state)
was augmented to house the current depth of the template being
parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
so that SemaType.cpp::ConvertDeclSpecToType may use it to immediately
generate a template-parameter-type when 'auto' is parsed in a generic
lambda parameter context. (i.e we do NOT use AutoType deduced to
a template parameter type - Richard seemed ok with this approach).
We encode that this template type was generated from an auto by simply
adding $auto to the name which can be used for better diagnostics if needed.

- SemaLambda.h was added to hold some common lambda utility
functions (this file is likely to grow ...)

- Teach Sema::ActOnStartOfFunctionDef to check whether it
is being called to instantiate a generic lambda's call
operator, and if so, push an appropriately prepared
LambdaScopeInfo object on the stack.

- various tests were added - but much more will be needed.

There is obviously more work to be done, and both Richard (weakly) and Doug (strongly)
have requested that LambdaExpr be removed form the CXXRecordDecl LambdaDefinitionaData
in a future patch which is forthcoming.

A greatful thanks to all reviewers including Eli Friedman, James Dennett,
and especially the two gracious wizards (Richard Smith and Doug Gregor)
who spent hours providing feedback (in person in Chicago and on the mailing lists).
And yet I am certain that I have allowed unidentified bugs to creep in; bugs, that I will do my best to slay, once identified!

Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
7fda20777785ae0076aa9f1c49ff6639cb7299ef 10-Sep-2013 Nick Lewycky <nicholas@mxc.ca> Generate code for the move assignment operator using memcpy, the same as we do
for the copy assignment operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
3b8e0b7f96164e8c49d2a833da26edd960f5da1f 30-Aug-2013 Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> Revert r189649 because it was breaking sanitizer bots.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
51a31e1da76cc0906e4708ae15e2f7ecf1ba5f13 30-Aug-2013 Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> Fixing a bug where debug info for a local variable gets emitted at file scope.

The patch was discussed in Phabricator. See:
http://llvm-reviews.chandlerc.com/D1281



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
c3030bc285d90a139fb74629daadef5617283203 26-Aug-2013 David Blaikie <dblaikie@gmail.com> Simplify/clean up debug info suppression in CodeGenFunction

CodeGenFunction is run on only one function - a new object is made for
each new function. I would add an assertion/flag to this effect, but
there's an exception: ObjC properties involve emitting helper functions
that are all emitted by the same CodeGenFunction object, so such a check
is not possible/correct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
152b4e4652baedfceba1cd8115515629225e713f 22-Aug-2013 Manuel Klimek <klimek@google.com> Revert "Implement a rudimentary form of generic lambdas."

This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
ecb5819a9e64fb654d46a3b270a286cc570c58ff 22-Aug-2013 Faisal Vali <faisalv@yahoo.com> Implement a rudimentary form of generic lambdas.

Specifically, the following features are not included in this commit:
- any sort of capturing within generic lambdas
- nested lambdas
- conversion operator for captureless lambdas
- ensuring all visitors are generic lambda aware


As an example of what compiles:

template <class F1, class F2>
struct overload : F1, F2 {
using F1::operator();
using F2::operator();
overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
};

auto Recursive = [](auto Self, auto h, auto ... rest) {
return 1 + Self(Self, rest...);
};
auto Base = [](auto Self, auto h) {
return 1;
};
overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
int num_params = O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

Some implementation notes:

- Add a new Declarator context => LambdaExprParameterContext to
clang::Declarator to allow the use of 'auto' in declaring generic
lambda parameters

- Augment AutoType's constructor (similar to how variadic
template-type-parameters ala TemplateTypeParmDecl are implemented) to
accept an IsParameterPack to encode a generic lambda parameter pack.

- Add various helpers to CXXRecordDecl to facilitate identifying
and querying a closure class

- LambdaScopeInfo (which maintains the current lambda's Sema state)
was augmented to house the current depth of the template being
parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
so that Sema::ActOnLambdaAutoParameter may use it to create the
appropriate list of corresponding TemplateTypeParmDecl for each
auto parameter identified within the generic lambda (also stored
within the current LambdaScopeInfo). Additionally,
a TemplateParameterList data-member was added to hold the invented
TemplateParameterList AST node which will be much more useful
once we teach TreeTransform how to transform generic lambdas.

- SemaLambda.h was added to hold some common lambda utility
functions (this file is likely to grow ...)

- Teach Sema::ActOnStartOfFunctionDef to check whether it
is being called to instantiate a generic lambda's call
operator, and if so, push an appropriately prepared
LambdaScopeInfo object on the stack.

- Teach Sema::ActOnStartOfLambdaDefinition to set the
return type of a lambda without a trailing return type
to 'auto' in C++1y mode, and teach the return type
deduction machinery in SemaStmt.cpp to process either
C++11 and C++14 lambda's correctly depending on the flag.

- various tests were added - but much more will be needed.

A greatful thanks to all reviewers including Eli Friedman,
James Dennett and the ever illuminating Richard Smith. And
yet I am certain that I have allowed unidentified bugs to creep in;
bugs, that I will do my best to slay, once identified!

Thanks!




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
0a1c862914664029e3b6693e134cf3ccbf423844 19-Aug-2013 David Blaikie <dblaikie@gmail.com> PR16933: Don't try to codegen things after we've seen errors.

Refactor the underlying code a bit to remove unnecessary calls to
"hasErrorOccurred" & make them consistently at all the entry points to
the IRGen ASTConsumer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
3b477597fa1184b223ad5ad9dfe1c870b8aa1ac5 25-Jul-2013 Adrian Prantl <aprantl@apple.com> Debug Info: Fine-tune the simple return expression location handling to
only affect functions without a separate return block. This fixes the
linetable for void functions with cleanups and multiple returns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187090 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
226399ce18cdcbb1e83af7c5e644bdabb9d4f2f8 13-Jul-2013 David Blaikie <dblaikie@gmail.com> Correctly classify pack expansions as NON_CANONICAL_UNLESS_DEPENDENT

Test coverage for non-dependent pack expansions doesn't demonstrate a
failure prior to this patch (a follow-up commit improving debug info
will cover this commit specifically) but covers a related hole in our
test coverage.

Reviewed by Richard Smith & Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
12df246d6dea2ee1f92c186f922f1afcf499647a 24-Jun-2013 Reid Kleckner <reid@kleckner.net> [AST] Introduce a new DecayedType sugar node

The goal of this sugar node is to be able to look at an arbitrary
FunctionType and tell if any of the parameters were decayed from an
array or function type. Ultimately this is necessary to implement
Microsoft's C++ name mangling scheme, which mangles decayed arrays
differently from normal pointers.

Reviewers: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
ece7ebd2f2d03dc58fa1937a6d53e2a9f8c410f1 30-May-2013 Adrian Prantl <aprantl@apple.com> fix formatting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
3081c6fe13fbefc398e685a34fe7ba644c209ecd 16-May-2013 Adrian Prantl <aprantl@apple.com> Clarify comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
dc7a4f5d7a7e3b60d4dc4a80338d7a2728540998 30-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't treat a non-deduced 'auto' type as being type-dependent. Instead, there
are now two distinct canonical 'AutoType's: one is the undeduced 'auto'
placeholder type, and the other is a deduced-but-dependent type. All
deduced-to-a-non-dependent-type cases are still non-canonical.


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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
94d46b55103bf7ba0dc5425baf1eb7e4adcaa7ea 26-Mar-2013 Manman Ren <mren@apple.com> Fix uninitialized read of CalleeWithThisReturn.

Initialize CalleeWithThisReturn to 0 in the constructor.
Also revert r170815 since checking CalleeWithThisReturn is faster.

PR15598


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
f4492448a201c352be3d2e1e76220cf7cd499c55 24-Mar-2013 Benjamin Kramer <benny.kra@googlemail.com> Simplify code. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
1db7040604154f71c54cf1329ae384fbef196668 24-Mar-2013 Guy Benyei <guy.benyei@intel.com> Generate metadata to implement the -cl-kernel-arg-info option.
OpenCL 1.2 spec. 5.7.3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
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.cpp
bea522ff43a3f11c7a2bc7949119dbb9fce19e39 08-Mar-2013 Jordan Rose <jordan_rose@apple.com> ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.

No (intended) functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
c5139a9f0c9d4f835e4ab0b51e78d2f74fb488d9 23-Feb-2013 David Blaikie <dblaikie@gmail.com> Prefer 'and' over '&' in comments.

Post commit code review feedback from Matt Beaumont-Gay on r174248.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
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.cpp
c8c24277a8cce39db95b0e05b79cbdf7e7558355 02-Feb-2013 David Blaikie <dblaikie@gmail.com> Revert r174246, accidentally committed.

This reverts commit 1513eb9284c23acfd19cf742b95996fbb11ca741.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
9ceca75892202e1791fb002be6418c8720d74912 02-Feb-2013 David Blaikie <dblaikie@gmail.com> Sentenc-ify comment added in r174206.

Based on post-commit review by Paul Robinson.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
1513eb9284c23acfd19cf742b95996fbb11ca741 02-Feb-2013 David Blaikie <dblaikie@gmail.com> Basics

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


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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
72390b39c545426023ec104afe8706395d732bad 20-Dec-2012 Bill Wendling <isanbard@gmail.com> Rename llvm::Attributes to llvm::Attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
ad017fa7a4df7389d245d02a49b3c79ed70bedb9 20-Dec-2012 Bill Wendling <isanbard@gmail.com> Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
094dbf917127a1228147587076d59ca45b7c258d 19-Dec-2012 Bill Wendling <isanbard@gmail.com> Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
29573b0a825b888c233d7859a257e866ffc5276e 09-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Unbreak the clang build after r169712.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
cdeb7d57a4867c28e3e6a8c391cba6f13c781fa6 04-Dec-2012 Michael Ilseman <milseman@apple.com> Have clang use LLVM IR's fast-math flags when in FastMath or FiniteMathOnly modes. Test cases included.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
9dce4b3d9d14ba2be2aad5bd7fd8d381a0263c36 04-Dec-2012 Michael Ilseman <milseman@apple.com> remove trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
8fd8ee9b718a7d6ebbcc382c1de39ed1260fe2d3 15-Nov-2012 Benjamin Kramer <benny.kra@googlemail.com> Simplify code. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
f5bf912767ba19832bba7694fc679a5ec3c055ff 14-Nov-2012 Eli Friedman <eli.friedman@gmail.com> When evaluating variably modified types for function parameters, dig out the
type as written from the ParmVarDecl; it's unclear whether the standard
(C99 6.9.1p10) requires this, but we're following the precedent set by gcc,
and hopefully nobody will ever ask about this again.

PR9559 / <rdar://problem/12621983>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
7edf9e38b91917b661277601c0e448eef0eb2b56 01-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Simplify: replace getContext().getLangOpts() with just getLangOpts().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
956a5a17713deb1b5b27893303c4f308a1bd2a62 25-Oct-2012 Micah Villmow <villmow@gmail.com> Cleanup some clang code to use new type functions instead of using cast<>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
4cdad3151bfb2075c6bdbfe89fbb08f31a90a45b 23-Oct-2012 Douglas Gregor <dgregor@apple.com> Switch CodeGenOptions over to a .def file, like we do with LangOptions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
802cd5b1974bab2038b9d3c969d9beb0ab34f435 15-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> At -O0, emit an @llvm.trap() call at the end of a value-returning function which
fails to return a value, to make debugging this issue easier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
fac631052809b59c1b66f687c08a743de7fb50e9 10-Oct-2012 Bill Wendling <isanbard@gmail.com> Have 'addFnAttr' take the attribute enum value. Then have it build the attribute object and add it appropriately. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
bf43f2fdfbd7c4f8cd1f1403765eca9e5dc6c8ae 10-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Tidy up formatting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
930c05c32eac171ef1a94fabf80aecb4e6e2c840 10-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> -fcatch-undefined-behavior: catch a VLA bound which evalutes to a non-positive value.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
36ef0d54cfddf31cd48816e78ab4db73b31a6c1d 05-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> If we flow off the end of a value-returning function:
- outside C++, return undef (behavior is not undefined unless the value is used)
- in C++, with -fcatch-undefined-behavior, perform an appropriate trap
- in C++, produce an 'unreachable' (behavior is undefined immediately)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
6bebe5aca3c45c741303dd0ae12d0225bddbe2e6 16-Jul-2012 Chandler Carruth <chandlerc@gmail.com> Update Clang to reflect the move of MDBuilder in r160237.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
198871cc90375246d8692680467ff6e810edac36 12-Jul-2012 Tanya Lattner <tonic@nondot.org> Add OpenCL metadata for kernel arg names. This output is controlled via a flag as noted in the OpenCL Spec.
Includes a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
2ee5ba35febf830d366b65dd0dcbf8e291c41342 16-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup:
* Escaped Objective-C @keywords in Doxygen comments;
* Documented more accurate \params;
* Exposed some more summaries using \brief.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
def18494b97f554ea0d95db75627c3e77b74307f 22-May-2012 Nuno Lopes <nunoplopes@sapo.pt> wire -fbounds-checking to the new LLVM bounds checking pass

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
fd00eecad6fa5400cf37269d84361a0551d0e6d3 04-May-2012 Alexey Samsonov <samsonov@google.com> This patch adds a new Clang compiler flag "-gline-tables-only".
It reduces the amount of emitted debug information:
1) DIEs in .debug_info have types DW_TAG_compile_unit, DW_TAG_subprogram,
DW_TAG_inlined_subroutine (for opt builds) and DW_TAG_lexical_block only.
2) .debug_str contains only function names.
3) No debug data for types/namespaces/variables is emitted.
4) The data in .debug_line is enough to produce valid stack traces with
function names and line numbers.

Reviewed by Eric Christopher.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
1664d540d1524f0faffd2f839fccb56178975c60 22-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12571: Objects of type clang::ConstantArrayType aren't always emitted with
type llvm::ArrayType -- sometimes we emit them as packed structs. Don't assert
if such a global array has an element type with a non-trivial destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
3c6ed1b5c50de8ab9375e59fd68ea2a9e5ae8c30 16-Apr-2012 Duncan Sands <baldrick@free.fr> Remove support for -fast-math metadata for the moment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
10e675d4824710426ab894336cfb659742c94d08 16-Apr-2012 Duncan Sands <baldrick@free.fr> Generate fpmath metadata when -ffast-math. Note that no optimizations are hooked
up to this yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
8fbe3855db0c341964bb550e13659505efe06c43 15-Mar-2012 Chad Rosier <mcrosier@apple.com> [frontend] Add support for disabling the "inline" keyword using
-fno-inline-functions.

This behaves much like -fno-inline in gcc, but based on a discussion with
Daniel it was decided that -fno-inline-functions should subsume -fno-inline.
Please speak up if you object. The -fno-inline flag remains ignored.
Final part of rdar://10972766



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152754 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
6e94f6c0f124c9a88b3dae0eea5e6b27957df183 18-Feb-2012 Chad Rosier <mcrosier@apple.com> Remove redundant check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
df33a35f6010fea92c786c0d8f85bfd7c73ebd3e 14-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Remove useless if statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
af2771b147f1a5934c6c91574f1c2df986034e74 08-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> CodeGen: Move EHPersonality from CGException.h into the cpp file, it has no other users.

While at it make it value-initializable to get rid of static ctors.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
5ff53b27dfd918a5d9943cd008de51edc8cbec2c 11-Jan-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed VLA code generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
06284c1dc56caed19850bc3766c89f51763724c3 07-Jan-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed TypeofExpr AST and code generation.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
2a04f1cf72d57cf5d74b24e785c04f7a3fc3398f 24-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Fix mismatched new[]/delete[].

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
06253664315307d34ab57b892b6a0c6c5b3153bb 22-Oct-2011 Eric Christopher <echristo@apple.com> Fix PR11073 by adding the argument type information to the decl we construct
for the function type. Update a testcase accordingly.

Patch initially by Anders Waldenborg!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
73fb35003aad027492e661a3749e921b5d1ecaf9 13-Oct-2011 Eric Christopher <echristo@apple.com> Recommit:

Start handling debug line and scope information better:

Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.

Finishes off the rest of rdar://10246360

after fixing a few bugs that were exposed in gdb testsuite testing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
b001de7458d17c17e6d8b8034c7cfcefd3b70c00 07-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.

Thanks to Jeffrey Yasskin for the thorough review!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
a4ae2294b6ebfb2554aacb6a6a0682fb5ed1f276 06-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> CUDA: IR generation support for device stubs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
578faa837b552403e2002b97fdfbfde14f2448e5 27-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> de-tmpify clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
acae01124151392a842bd6c37bd01b1ad56d6b4d 09-Sep-2011 Eric Christopher <echristo@apple.com> Carry the debug information from single exit unified return block
along with the new insert point.

Fixes PR10829

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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
0f6ac7cf7bc6a02c1a5c19d2c90ec0d1dd7786e7 22-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use
ArrayRef.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
8dd55a3c3b28d195717c87bbc60e765951d408fe 14-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> Change intrinsic getter to take an ArrayRef, now that the underlying function in LLVM does.

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
95d318c4c10437db40ca6e15fdf32e04012da58e 28-May-2011 Benjamin Kramer <benny.kra@googlemail.com> Eliminate temporary argument vectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
7aa488a7fc5c3a8cd1a2b93476150e9737760713 17-May-2011 Ted Kremenek <kremenek@apple.com> Fix crash on C++ code when compiling with -finstrument-functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
79be76c0e360d9e9c44285c9838af02adc43e55f 22-Apr-2011 Ken Dyck <kd@kendyck.com> Eliminate some literal 8s from EmitNullInitialization() by converting
variables to CharUnits. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
6f141659cab11109d9931d92d0988f8850778de3 21-Apr-2011 Jay Foad <jay.foad@gmail.com> PR9214: Convert Metadata API to use ArrayRef.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
bbf3bacb3e0c1ebb3e8a4a8b1330404a7e379315 30-Mar-2011 Jay Foad <jay.foad@gmail.com> Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
e3eb83b93751544a5fab19b3824f56aeac454f82 04-Mar-2011 Bill Wendling <isanbard@gmail.com> Initialize variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
2bef7f5499541e3b68f114cc4d7d197e9a902fe7 28-Feb-2011 Chris Lattner <sabre@nondot.org> fix my containsBreak predicate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
f315fa81eef1977b3457fd7a7d4639e060fe7278 14-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: add support for __kernel, kernel keywords and EXTENSION,
FP_CONTRACT pragmas. Patch originally by ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
7502c1d3ce8bb97bcc4f7bebef507040bd93b26f 13-Feb-2011 John McCall <rjmccall@apple.com> Give some convenient idiomatic accessors to Stmt::child_range and
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
a18652fe1e8233fbf8b67484945c7f7b2bf272be 10-Feb-2011 Daniel Dunbar <daniel@zuster.org> IRgen: Fix an immediate-exit-from-fn style nit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
7143325db76d6c3dabce82500f8cc7c93a941970 01-Feb-2011 John McCall <rjmccall@apple.com> Do the right thing for zero-initializing VLAs that don't have a zero
bit-pattern. It's not clear that this is actually useful given current
language restrictions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
36f893c1efe367f929d92c8b125f964c22ba189e 28-Jan-2011 John McCall <rjmccall@apple.com> Move all the cleanups framework code into a single file.
Pure motion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
5576d9b0a389f6f1f89bdcd37194f4e992b1fbcb 14-Jan-2011 John McCall <rjmccall@apple.com> Support the zero-initialization of VLAs when that really means a zero
bit-pattern. Continue punting on zero-initializing VLAs with a nonzero
pattern.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
b8424370ff7ebb63db04b2398ddaa92e829582a4 14-Jan-2011 John McCall <rjmccall@apple.com> When simplifying a cleanup's entry by merging it into a single predecessor,
replace all uses of the entry with the predecessor. There are no cleanups
relying on this right now, but if we ever want a cleanup with a phi inside
it, this will be important.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
9f0c7cc36d29cf591c33962931f5862847145f3e 30-Dec-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify mem{cpy, move, set} creation with IRBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
e23cf437fe76b1ed02d63c3f61b456fd48a915f5 14-Dec-2010 John McCall <rjmccall@apple.com> Restore r121752 without modification.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
5bfe232d1f07a6fd160fcf82c277c055a412a1c0 14-Dec-2010 John McCall <rjmccall@apple.com> Pull out r121752 in case it's causing the selfhost breakage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
0e88aa7100da32acc63bc8a4dcb946ed517868f1 14-Dec-2010 John McCall <rjmccall@apple.com> Factor out most of the extra state in a FunctionProtoType into a separate
class to be passed around. The line between argument and return types and
everything else is kindof vague, but I think it's justifiable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
075f8f1b6bed4d1b224c74f87508534cc6392ce6 10-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added ParenType type node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
bc07a55b68342a230aafd8875cc7a26450dd3f64 30-Oct-2010 Dan Gohman <gohman@apple.com> Use CodeGenFunction's getContext(), for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
d2829b76a87a70791184b3cac89900d2cda46ce4 06-Oct-2010 Devang Patel <dpatel@apple.com> Remove unused argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
e71d60d2c948bef21443c3370a9922a2f58bcc3a 05-Oct-2010 John McCall <rjmccall@apple.com> Teach PopCleanupBlock to correctly handle the possibility of branching through
a EH-only cleanup as part of a fallthrough branch-through. That this happens
for this test case is actually a separate bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
0680e97465a5d0ef78fd71ea7b806d9df239b3ca 05-Oct-2010 John McCall <rjmccall@apple.com> If we're resolving all outstanding fixups, and there are multiple fixups
for the same destination, then we must potentially rewrite the initial branch
of every fixup. Without this patch, a short-circuit check meant to prevent
a switch case from being redundantly added was preventing later fixups from
being processed. Fixes PR8175 (again).



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



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



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



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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
b3a29f132794f67108bccc9c7cc3795365e8a965 12-Aug-2010 John McCall <rjmccall@apple.com> Revise r110163: don't mark weak functions nounwind, because the optimizer
treats that as a contract to be fulfilled by any replacements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
faa3449a0f8b61ff25bd6aba78c50cabab213c24 11-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> IRGen support for functions returning objc object
types. Fixes PR7865.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
9021718882441dd391a1960084580d3cd19c423a 07-Aug-2010 John McCall <rjmccall@apple.com> Inline a special case of EmitAggregateCopy into EmitNullInitialization
to avoid the awesome-but-wrong-in-this-case assertion in the canon EAC.
Fixes PR7834.

Also fix a subtle address-space bug in the memset path.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110511 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
39dad53772c42eb36ebec1c81c56ba99d038fb94 04-Aug-2010 John McCall <rjmccall@apple.com> Do a very simple pass over every function we emit to infer whether we can
mark it nounwind based on whether it contains any non-nounwind calls.
<rdar://problem/8087431>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
7cd4b060f1e59f6d29126383ceee614e4772f859 27-Jul-2010 John McCall <rjmccall@apple.com> Test for the presence of EH branch-throughs instead of normal branch-throughs.
I knew this code duplication would bite me.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
ff331c15729f7d4439d253c97f4d60f2a7ffd0c6 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
5a6fbcfd8c15a2296f94a0473a68ec09d429827f 23-Jul-2010 Devang Patel <dpatel@apple.com> Keep track of artificial scopes introduced by line directives. For example,

#line 41 "bar.c"
dummy (1, i);
#line 24 "bar.h"
i = f2 (i);
#line 44 "bar.c"

This is tested by step-line.exp in gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
4d939e64142126b872e39c11dc995aa993f137fe 21-Jul-2010 Devang Patel <dpatel@apple.com> Remove unused argument.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
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.cpp
66d80a9c99ef781f0fd56dfcd060e30d4d673c93 06-Jul-2010 John McCall <rjmccall@apple.com> When destroying a cleanup, kill any references to instructions in the entry
block before deleting it. Fixes PR7575.

This really just a short-term fix before implementing lazy cleanups.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
34161996e5bec20bcc3a97894a3a38f2d0f56c72 01-Jul-2010 Daniel Dunbar <daniel@zuster.org> Revert "IRgen: Make sure any prolog instructions get debug info.", the lexical
scope hasn't been set up yet so this isn't valid. It was just a cleanup to the
IR, so I'm going to ignore it for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107356 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
727bd9731c4d9f8a369dc82afae39ad9877f92ab 30-Jun-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Make sure any prolog instructions get debug info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
fbe02ffb573ac2aa51351278af1c7970573b6ed5 27-Jun-2010 Chris Lattner <sabre@nondot.org> misc tidying


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
8dab6571b2cab96f44d0a1d6e3edbfdb68b7ed6b 23-Jun-2010 Chris Lattner <sabre@nondot.org> polish the -finstrument-functions implementation, patch by Nelson Elhage!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
35415f5132f70ad5097a3514ab84251e10db3664 25-May-2010 Douglas Gregor <dgregor@apple.com> Improve name mangling for blocks and support mangling of static local
variables within blocks. We loosely follow GCC's mangling, but since
these are always internal symbols the names don't really matter. I
intend to revisit block mangling later, because GCC's mangling is
rather verbose. <rdar://problem/8015719>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
0d7c583a4b4d0f57c6b69c66fd73babec4ef3799 03-May-2010 Anders Carlsson <andersca@mac.com> Don't copy or initialize empty classes. Fixes PR7012.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
cd9199eb3dd1a665ea642f3918020a53e5ecb673 13-Apr-2010 Devang Patel <dpatel@apple.com> Fix debug info for cleanup block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
3ecd785aff34381f3704d9cb28fe3ef85af759de 04-Apr-2010 Mon P Wang <wangmp@apple.com> Reapply patch for adding support for address spaces and added a isVolatile field to memcpy, memmove, and memset.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
c90f56d9f144b2dce88d1c141ddf0e0940e62e63 02-Apr-2010 Mon P Wang <wangmp@apple.com> Revert r100193 since it causes failures in objc in clang


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
8facca6cafa8d471768fe14074b1301e24e08fec 02-Apr-2010 Mon P Wang <wangmp@apple.com> Reapply patch for adding support for address spaces and added a isVolatile field to memcpy, memmove, and memset.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
b5896c37922e09529e61db4b3dd946cf2ecb211e 31-Mar-2010 Bob Wilson <bob.wilson@apple.com> Revert Mon Ping's 99930 due to broken llvm-gcc buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
3b5caa20652c43d00229bac972b78bee44a0ee9f 30-Mar-2010 Mon P Wang <wangmp@apple.com> Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
264ba48dc98f3f843935a485d5b086f7e0fdc4f1 30-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> the big refactoring bits of PR3782.

This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
ce056bcaa1c97b89a4b2de2112c62d060863be2b 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
3b47733ceac33306bd54ce9d6c7d8eeeae52c7ca 18-Feb-2010 John McCall <rjmccall@apple.com> Make deleting and complete dtor variants defer to other dtor variants by
calling them as subroutines. This triggers whenever the alias optimization
doesn't, i.e. when the dtor has linkonce linkage or there are virtual bases
or it's the deleting dtor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
647a1ec397fa13af176d07d9f5d071560a94c7a9 16-Feb-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Switch 'retval' to use CreateIRTemp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
a3fe2842e0cf953241ccc05809afdf84f13798e9 09-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Pass inline keyword to optimizer as the new InlineHint function attribute.

At the moment the inlinehint attribute is ignored by the Inliner unless you
pass a -respect-inlinehint option. This will soon be the default.

The inlinehint attribute is set if the inline keyword is explicitly specified
on any declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
1851a12605bc6f1ea70d11974a315340ebaab6eb 07-Feb-2010 Anders Carlsson <andersca@mac.com> Make sure to set vtable pointers in the destructors as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
04a67a6aa3dfdc92d57f7f8d93ba397348c868a4 05-Feb-2010 John McCall <rjmccall@apple.com> Standardize the parsing of function type attributes in a way that
follows (as conservatively as possible) gcc's current behavior: attributes
written on return types that don't apply there are applied to the function
instead, etc. Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks). Consistently consume CC/noreturn
information throughout codegen; enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
9c6c3a0e3ae09626d2d4b04e4ffa42c3d7cab32b 14-Jan-2010 Devang Patel <dpatel@apple.com> Emit human readable names for c/c++ functions. Avoid emitting linkage name if it matches regular name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
9e9199d8649cf3e10c98a69403f05dbb666d8fb1 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since the context is available in the Decl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
155fd79b3a6dd25fbac1716fa3f8148de1e53c49 08-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Use StringRef in CGDebugInfo::EmitFunctionStart.


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




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
5e1b91875c275f0ec50d3680afbac150d684fdba 06-Nov-2009 Anders Carlsson <andersca@mac.com> If a member variable of reference type is bound to a temporary in its member initializer it needs to be destroyed at the end of the constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
4365bba95be15342575b4f030c6583a770a5da3d 06-Nov-2009 Anders Carlsson <andersca@mac.com> Cleanup ctor/dtor emission.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
85e74acfcfb0c835a2e6c1adab314e997917039a 28-Oct-2009 Chris Lattner <sabre@nondot.org> factor a creation of Int32Ty.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
91cc815ffd13d4a78ae1b5bd617e19dd555de4f4 23-Oct-2009 Mike Stump <mrs@apple.com> Fixup the return type of functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
9329a5c2924bc2c6379d7c202a4b312321edd719 13-Oct-2009 Chris Lattner <sabre@nondot.org> number address-taken labels from 1. This allows 0 to be used as a sentinel
for a null pointer. In other words, "&&foo != NULL" will always work out to
true.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
36afd38fb749ab34c8341a1dc70366bca904eaa3 13-Oct-2009 Chris Lattner <sabre@nondot.org> Use the new Type::getInt8PtrTy method. This should probably be used in a lot
more places in clang codegen now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
c33e4ba20304e222692e77f2c6ad26a5d8d32f83 06-Oct-2009 Anders Carlsson <andersca@mac.com> Emit the destructor epilogue in a cleanup block so a return from a destructor body still calls the epilogue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
4513272f444c59705123ccb6207414ce62c9a568 01-Oct-2009 Douglas Gregor <dgregor@apple.com> CodeGen may see out-of-line declarations of the various special member
functions when they are explicitly declared, e.g., via a function
template specialization or explicit template instantiation
declaration. Don't try to synthesize bodies for the special member
functions in this case; rather, check whether we have an implicit
declaration and, if so, synthesize the appropriate function
body. Fixes PR5084.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
e322f30486249659c61dce9554be71cdbd71430a 29-Sep-2009 Anders Carlsson <andersca@mac.com> Make hasAggregateLLVMType use positive checks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
bcdc0f0aff015b6507560f50c71d1b7b6c6a9932 25-Sep-2009 Mike Stump <mrs@apple.com> Fix 80-col violation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
183700f494ec9b6701b6efe82bcb25f4c79ba561 22-Sep-2009 John McCall <rjmccall@apple.com> Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
1860a31edf826bc4001e153f1a8c10e17d97af87 11-Sep-2009 Anders Carlsson <andersca@mac.com> Pass the GlobalDecl to getMangledName, fixes PR4890.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
383d29853331e4f6c0c720a1df9cab31f6ab3dba 29-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to ir-gen user-defined conversions used in expressions
[12.3.2-p3]



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
1feade8e520be483293dbf55eb57a51720899589 27-Aug-2009 Mike Stump <mrs@apple.com> Regularize the case and sort.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
ec18ddd33d5dc2cba5f64fa903bac7a83dc1e01e 15-Aug-2009 Chris Lattner <sabre@nondot.org> minor cleanups for VLA stuff.


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


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
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.cpp
9889652dbc10060cd604861ed2e5bc6719f845b0 07-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch toward synthesizing copy constructors.
Work in progress.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
c7ff8e19081c2e974f05f66c4fa9b40750fc655f 31-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Synthesize the default constructor which has not
been declared as needed.


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


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


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

And remove Type::getAsReferenceType(), etc.

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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
42719fc8145cb0da244b1826551e6b441db89209 23-Jul-2009 Daniel Dunbar <daniel@zuster.org> Shield clang from LLVM API changes, until the dust settles.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
e7d346b6d5cee14b75e34928b3fd423f21d8d80d 21-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Move EmitCtorPrologue to CGCXX. Add an assert and FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
5ac2323decadeccf22659b828771155f0c70bed9 20-Jul-2009 Mike Stump <mrs@apple.com> Remove an apparently unused header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76473 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
96e18b05ea6b55aa92a1a576f29e9cee73a7e20b 19-Jul-2009 Daniel Dunbar <daniel@zuster.org> Catch another trivial case where we can avoid emitting a separate return blcok.


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
1a1a6e2bd4c5aefd7fd643cf25915f9623a02e59 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.



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


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75041 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
6fb0aee4f9dc261bbec72e1283ad8dc0557a6d96 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.

Timings showed no significant difference before and after the commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
40b598eea1310ec9ed554d56ce3e25b34c585458 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
68584ed35ad819a1668e3f527ba7f5dd4ae6a333 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
eb6437a9b23b3d98a4590ba5557111e14eba2edf 31-May-2009 Anders Carlsson <andersca@mac.com> When possible, don't emit the cleanup block. Instead, just move the instructions to the current block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
bdad6b69f1214fb20116795f8e8cbf881e3017c6 29-May-2009 Eli Friedman <eli.friedman@gmail.com> Re-add a slightly more general version of the check from r72578; it is
actually necessary in some obscure cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
c9bb1b8e4e6d46ce6c9691dc72757f2a8f71b57b 29-May-2009 Mike Stump <mrs@apple.com> Oops, the testcase I was thinking of is supposed to error out. I
tried other things that might trip, but they all worked.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
8ebefded18aa3c83b6b4ce3713060c94432f9859 29-May-2009 Mike Stump <mrs@apple.com> Fixup codegen for composition of vla types using a normal array type.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71937 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
d3a413d3b8eb39bcee5944bc545d9997c1abe492 26-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement function-try-blocks. However, there's a very subtle bug that I can't track down.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
88207c9ca218486b93ae7df14e9764cd0c2c3383 21-Apr-2009 Chris Lattner <sabre@nondot.org> don't bother emitting a zero byte memset at all. We used to get them
in cases like this:

typedef struct {
short instance;
char name[0];
} ATTR_LIST_ENTRY2;

void test() {
ATTR_LIST_ENTRY2 X = (ATTR_LIST_ENTRY2) { .instance = 7, };
}

While it is safe to emit them, it is pretty silly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
7297134f128423fce2e88f92421ed135bded7d4e 18-Apr-2009 Douglas Gregor <dgregor@apple.com> FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
d7c62b1929b024047a06697d2fedbd4c2e7d0cdf 15-Apr-2009 Anders Carlsson <andersca@mac.com> Simplify CodeGenFunction::GenerateCode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
b11fa0d25d86169f0e0a29d5398116c0212bb787 13-Apr-2009 Daniel Dunbar <daniel@zuster.org> Update to use hasAttr() instead of getAttr().
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
b75863d53b8a2bbf0ece8e6df2b6e5be7f3896c4 10-Apr-2009 Chris Lattner <sabre@nondot.org> reject codegen of __thread variables as unimplemented, rdar://6775265


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
48f9122dc6f1f1cef540246b0412d8ff9e90a868 28-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Move where block-related variables are initialized so that block
types don't get generated when blocks aren't used.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
f1466848dce9c4c75d96a6cabdc8db560e26aac8 22-Mar-2009 Chris Lattner <sabre@nondot.org> fix CreateTempAlloca to not set a name on the alloca for temporaries
in release-assert builds. For automatic variables, explicitly set
a name with setName that does not make a temporary std::string.

This speeds up -emit-llvm-only -disable-free on PR3810 by 4.6%


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
0ae7b2b2f964bd6145d65ef52dc2a28025b2bd06 17-Mar-2009 Anders Carlsson <andersca@mac.com> Initialize the cleanup.dst variable if necessary. Fixes PR3789.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
a4f668f3b7e03629066a01b04e415cb2b4655daf 06-Mar-2009 Mike Stump <mrs@apple.com> Framework for codegen for copy/dispose helpers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
797b6327571f9d7b1c45404a56ddcbf9b9298ae8 05-Mar-2009 Mike Stump <mrs@apple.com> Add codegen support for __block variables to call _Block_object_dispose as necessary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
24a9f6e11d222f2d9feaf5f9605c1a66006f7061 26-Feb-2009 Daniel Dunbar <daniel@zuster.org> Drop uses of isPointerLikeType.
- No functionality change.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
6ec3668a2608b63473207319f5ceff9bbd22ea51 19-Feb-2009 Douglas Gregor <dgregor@apple.com> Address Chris's comments regarding C++ name mangling.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
5f2bfd4811996abb783aa6c7254c56baa6930e8c 13-Feb-2009 Douglas Gregor <dgregor@apple.com> Add basic support for C++ name mangling according to the Itanium C++
ABI to the CodeGen library. Since C++ code-generation is so
incomplete, we can't exercise much of this mangling code. However, a
few smoke tests show that it's doing the same thing as GCC. When C++
codegen matures, we'll extend the ABI tester to verify name-mangling
as well, and complete the implementation here.

At this point, the major client of name mangling is in the uses of the
new "overloadable" attribute in C, which allows overloading. Any
"overloadable" function in C (or in an extern "C" block in C++) will
be mangled the same way that the corresponding C++ function would be
mangled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
b4094ea09eee7d3a847cadf181a81efc99003daf 10-Feb-2009 Daniel Dunbar <daniel@zuster.org> Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
cc8992021caf316a282116d509d2a4fb54349341 08-Feb-2009 Anders Carlsson <andersca@mac.com> Reuse case destinations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
ad9d00e371f4f4e63a540f4e4c501797db2a43de 08-Feb-2009 Anders Carlsson <andersca@mac.com> Always check if we can remove branch fixups, even if the cleanup stack is empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
46831a93e1805ddaebd68f37cdb5496a86b44cf0 08-Feb-2009 Anders Carlsson <andersca@mac.com> Misc fixes to the cleanup stack code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
1093c2c40a7c262d206d724e912b32cbad2d4e14 08-Feb-2009 Anders Carlsson <andersca@mac.com> Implement support for branch fixups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
96f214776c0f69069fee4d67557c8c7f416009a8 05-Feb-2009 Anders Carlsson <andersca@mac.com> Follow Eli's advice and store the VLA size with the native size_t type. Fixes PR3491.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
541b63b1a9db77e4a8670e9823711c2c12e58afb 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> Thread CGFunctionInfo construction through CodeGenTypes.
- Inefficient & leaks memory currently, will be cleaned up subsequently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
d7d6e6abff8cb25d8b1223fbc8865f8f2ff795e3 26-Jan-2009 Daniel Dunbar <daniel@zuster.org> Skip emission of final return block if possible (e.g., functions with
a unified return).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
a782ca76cc7dfdd69e331a4fa722fc23b18d5c34 09-Jan-2009 Daniel Dunbar <daniel@zuster.org> Block pointer types are not aggregate types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
fcdbb93749ed69aa9022437052c390522355ec3d 20-Dec-2008 Anders Carlsson <andersca@mac.com> Handle typedefs to VLAs (Emit the size expr when we encounter the typedef

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
751358ff73b155f5384e151e1d18aa3f6e7b061c 20-Dec-2008 Anders Carlsson <andersca@mac.com> Make sure to generate code for arguments that have a variably modified type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
64712f196bffd41fb0552c2643b07a25c3e45082 01-Dec-2008 Anders Carlsson <andersca@mac.com> Change more code over to using the new Expr::Evaluate

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
8ec03f58c33c33a917f54bb7f2cd61b6d7ffe0ca 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier. Update callers to do the right
thing and avoid this method in unsafe cases. This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
ef5a66d8171eb95e948107f8ee7707b360aaff25 22-Nov-2008 Anders Carlsson <andersca@mac.com> An expression is not foldable if it can't be fully evaluated. Fixes PR3060

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
2e1cd4264d363ca869bf37ef160902f211d21b8c 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
9615ecb44f549ae9fa2b4db6ff46bc78befbf62c 13-Nov-2008 Daniel Dunbar <daniel@zuster.org> Normalize many BasicBlock names.
- Use dotted notation for blocks related to a particular statement
type.
- Use .end for landing pads.

No functionality change in NDEBUG mode. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
36bc14c3a1cf63ee306df5687ac8e85f924f8639 12-Nov-2008 Daniel Dunbar <daniel@zuster.org> Quick fix for crash in IRgen when we can tryEvaluate a condition to
something that is not an int.

- Ignore these cases for now, added FIXME that we should also boolize
them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
09b14899039d828094c06ac25d60de62608e57b7 12-Nov-2008 Daniel Dunbar <daniel@zuster.org> Handle ?: in EmitBranchOnBoolExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
552f4c45ba4f4a01f86d585edabd871a27829867 12-Nov-2008 Chris Lattner <sabre@nondot.org> Handle Unary ! in EmitBranchOnBoolExpr, so that we can efficiently
codegen stuff like "if (!(X && Y))"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
f5bd45c8e6fa7519cdc17ec3ff4917e279c6a041 11-Nov-2008 Daniel Dunbar <daniel@zuster.org> Emit debug region end in unified return block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
f84dcda7e2ab2f6d5be5a8c52d22ef4c442dd762 11-Nov-2008 Daniel Dunbar <daniel@zuster.org> Remove CodeGenFunction::StartBlock.
- Was confusing and only used in one small part of the code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
2149470b6aca57e9ca2b7fb80416932ca75bbff7 28-Oct-2008 Daniel Dunbar <daniel@zuster.org> Don't run the verifier as part of IRgen, this is now down (per module)
in the driver (this means we no longer run the verifier per function, however).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
66031a5594bc9a7dc0dc5137c3e7955f835e4639 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> Change CGDebugInfo::setLocation to just ignore invalid locations. This
simplifies clients.

Also, add assert that RegionStack is empty when the CGDebugInfo is
destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
b01d191a25f92884855117ee7113a1bd3b59cdbc 27-Sep-2008 Daniel Dunbar <daniel@zuster.org> Simplify code to emit the unified return block and move it to the end
of the function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
b43f3925e335102d292ed6657e64a1471389627f 17-Sep-2008 Daniel Dunbar <daniel@zuster.org> Print current function on verification failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
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.cpp
eb4b7051a596560ef4a1846e3714707f44e9dc30 25-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Do typechecking and codegen for K&R-style function declarations
correctly. Not a regression, but made more obvious by my recent fix
which made function type compatibility checking a bit more strict.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
acc5f3e42334525bf28c86471551f83dfce222d5 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Kill unnecessary #includes in .cpp files. This is an automatic
sweep so some things removed are actually used, but happen to be
included by a previous header. I tried to get rid of the obvious
examples and this was the easiest way to trim the #includes in one
fell swoop.
- We now return to regularly scheduled development.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
76526a5245ec2283b0c85fcef507d4c2dec90715 04-Aug-2008 Daniel Dunbar <daniel@zuster.org> Avoid creating dummy block when no indirect gotos are present.


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

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

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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
1e9660e1fb11efb7e65799bc145c0e2b6f3562be 26-Jul-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6103124, the only dummy blocks are ones without names. Named blocks
are important part of control flow structures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
af99417156c652a6f04dff643925036dc3241d60 04-Jul-2008 Sanjiv Gupta <sanjiv.gupta@microchip.com> Fixed bugzilla bug# 2489.
This was broken when the GenerateCode function was splitted to use GenerateFunction.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
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.cpp
ff4a2d9e2c1ddbf87e00e2a36ae341faf03eafb3 01-Jun-2008 Eli Friedman <eli.friedman@gmail.com> First cut at setting attributes for functions and calls; this puts us
much closer to passing the gcc struct layout tests.

It might be possible to refactor this a bit, but I'm not sure there's
actually enough common code for that to be useful.

To get the calling convention completely correct, a bit of
platform-specific code is necessary even for x86-Linux. On x86-Linux, the
alignment of function parameters is extremely strange; as far as I can tell,
it's always 4 except for SSE vectors or structs containing SSE vectors. I'm
continuing to investigate this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
20ff3108fcd2c3bd734dc79efc22ebaa090abd41 01-Jun-2008 Anton Korobeynikov <asl@math.spbu.ru> Support for code generation of Objective-C top-level language constructs.
Implemented by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
1c6a38bcea17801e9a4738753aee845381af2b6c 25-May-2008 Sanjiv Gupta <sanjiv.gupta@microchip.com> Generate subprogram debug info with -g.
Also take care of freeing memory at the right places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51553 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
3f2af1002249c8acc9ce17f1fc50324864feb8e1 22-May-2008 Eli Friedman <eli.friedman@gmail.com> Make debugging information usable. This is barebones, but it makes -g
actually work (instead of crashing llc), and there's enough info emitted
to get line number information in gdb. This should hopefully be helpful
for debugging non-working programs.

I got rid of the begin/endregion calls because the implementation wasn't
working; someone who knows the debugging info a bit better might try to
add it. I really have no clue how a compiler is supposed to emit them.

This commit shouldn't have any effect without -g.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
72cefca3e196ba4e6b4f2c3a46c1a9fbf6d0894a 06-May-2008 Chris Lattner <sabre@nondot.org> remove a stray printout


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
a212c56e9b7533bcc2d6be90efd52ad241bf894e 04-May-2008 Chris Lattner <sabre@nondot.org> Simplify FunctionDecl::AddRedeclaration a bit by using std::swap.
Fix 'swapping' of attributes to not insert null values into the
DeclAttrs map.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
8fabd78f1976243cb223fb3e969c6f317d1ae44d 04-May-2008 Chris Lattner <sabre@nondot.org> if a decl is both 'static' and weak or static and inline, its linkage
type should be internal, not weak/linkonce.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
984d0b414bc76d3530b9bc55a5a55834ba76c607 06-Apr-2008 Gabor Greif <ggreif@gmail.com> tracking API changes arising from r49277

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
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.cpp
423a3c9c2719fb75133673e72ac881719df45daf 02-Apr-2008 Chris Lattner <sabre@nondot.org> simplify some code by using PointerLikeType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenFunction.cpp
ce5605ecf76d8cde6372138f830bb144d174ced9 31-Mar-2008 Chris Lattner <sabre@nondot.org> some cleanups on top of David's patch. There are still two
remaining open issues I've communicated to him:

1) self can be assigned to, and his patch didn't handle it correctly.
2) CollectObjCIvarTypes is N^2 (because each subclass reprocesses
all parent class ivars) and flattens classes. If A derives from B,
and both have an int, I'd expect to get { {i32}, i32}, not { i32, i32}.

David, please review.


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


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