History log of /external/clang/lib/CodeGen/CGCall.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 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/CGCall.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

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

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
c3f7fd67c8431ab1494f2d14725f5da03554365b 10-Oct-2013 Mark Lacey <mark.lacey@apple.com> Make CodeGenTypes data members private.

No functionality differences.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192390 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2529660fe6c9c40a69dd3d71c0a511e72579eaf2 02-Oct-2013 Mark Lacey <mark.lacey@apple.com> Use the CGCXXABI member on CodeGenTypes.

CodeGenTypes already has a reference to a CGCXXABI. Use this directly
rather than going through CodeGenModule to get to the same information.

This is consistent with other references to CGCXXABI in CodeGenTypes
functions defined in CGCall.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191854 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
5d4a7559df106959dd721744c8971547f0f09097 01-Oct-2013 Nick Lewycky <nicholas@mxc.ca> No functionality change. Reflow lines that could fit on one line. Break lines
that had 80-column violations. Remove spurious emacs mode markers on .cpp files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
e575359c34a9248c55ec0c03a8fc945f1ee4cb01 09-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Fix constructor-related typos.

Noticed by Roman Divacky.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
e8519c31a6ef853b627d557702ac1890f18ce2c9 30-Aug-2013 Charles Davis <cdavis5x@gmail.com> Add ms_abi and sysv_abi attribute handling.

Based on a patch by Benno Rice!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ef072033876e295ec5d3402f8730a3ae358ad815 28-Aug-2013 Reid Kleckner <reid@kleckner.net> Delete CC_Default and use the target default CC everywhere

Summary:
Makes functions with implicit calling convention compatible with
function types with a matching explicit calling convention. This fixes
things like calls to qsort(), which has an explicit __cdecl attribute on
the comparator in Windows headers.

Clang will now infer the calling convention from the declarator. There
are two cases when the CC must be adjusted during redeclaration:
1. When defining a non-inline static method.
2. When redeclaring a function with an implicit or mismatched
convention.

Fixes PR13457, and allows clang to compile CommandLine.cpp for the
Microsoft C++ ABI.

Excellent test cases provided by Alexander Zinenko!

Reviewers: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
fae228bccb2cbb74131d5dfbf0b021d69cd0c6fd 22-Aug-2013 Bill Wendling <isanbard@gmail.com> Only add this attribute when it's set. If it's not there, the assumption is that it's off.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8f189a9911a992a5c4118c3789485a85bd96e045 21-Aug-2013 Timur Iskhodzhanov <timurrrr@google.com> Abstract out virtual calls and virtual function prologue code generation; implement them for -cxx-abi microsoft

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
1cf9ab8ab8cf0fc72819d8aa68ba6cc328e33d05 01-Aug-2013 Bill Wendling <isanbard@gmail.com> Use function attributes to indicate if we don't want to realign the stack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187617 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
52d08fee6521aa1cea214f5d979f4d70b7b3c5d6 26-Jul-2013 Bill Wendling <isanbard@gmail.com> Use the new boolean to StringRef function to generate the proper StringRefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
cab4a09d69e7cc5c2c64ec1c3d126c4d825d2b83 25-Jul-2013 Bill Wendling <isanbard@gmail.com> Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
45ccf286af684ab40c2e4d6dd667e2c2e26946bf 22-Jul-2013 Bill Wendling <isanbard@gmail.com> Use the updated name for the attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8d230b454fa3a0d4fd87453e24c88219ef5ad14a 13-Jul-2013 Bill Wendling <isanbard@gmail.com> Use function attributes to pass along the stack protector buffer size instead of making it a target option.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
9b60195ad4843c9e2e231673a0dbc0d5c8c6eb2b 21-Jun-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Destroy temporary record arguments in the callee

Itanium destroys them in the caller at the end of the full expression,
but MSVC destroys them in the callee. This is further complicated by
the need to emit EH-only destructor cleanups in the caller.

This should help clang compile MSVC's debug iterators more correctly.
There is still an outstanding issue in PR5064 of a memcpy emitted by the
LLVM backend, which is not correct for C++ records.

Fixes PR16226.

Reviewers: rjmccall

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d39083deac93d6580a42ccd5d213aba2bb89cc76 11-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Fix a FIXME in a testcase about packed structs and calls I left around
while fixing a related bug. The fix here was simpler than I thought it
would be.

Fixes <rdar://problem/10530444>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
7e9f52f1faacf5505476418411127c5b16e07533 05-Jun-2013 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix CoerceIntOrPtrToIntOrPtr on big-endian targets.

Type coercion for argument passing is equivalent to storing the source
type and loading the destination type from the same pointer. On
big-endian targets, this means that the high bits of integers are
preserved.

This patch fixes the CoerceIntOrPtrToIntOrPtr() function on big-endian
targets by inserting the required shift instructions to preserve the
high bits instead of the low bits.

This is used by SparcABIInfo when passing small structs in the high bits
of registers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
90f9ec0dff7592c635e719909d288b5de04d224b 05-Jun-2013 Jakob Stoklund Olesen <stoklund@2pi.dk> Heed ABIArgInfo::getInReg() for return values.

The 'inreg' attribute can also be applied to function return values in
LLVM IR. The SPARC v9 backend is using the flag when returning structs
containing 32-bit floats.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
7c731f5ac7b995fe57c4bda87ed5f59c58a33eb5 30-May-2013 Adrian Prantl <aprantl@apple.com> Do not reuse the debug location of the return value's store if there is autorelease code to be emitted between store and return instructions. This is analoguous to what we do for lexical scope cleanups.

rdar://problem/13977888

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
5baefa84bc33a46bcf2d3ff636da1a88a38f975d 29-May-2013 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix bad indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
5543169296beeb183b9c9392debc774fcf493eeb 05-May-2013 Dmitri Gribenko <gribozavr@gmail.com> Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.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/CGCall.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/CGCall.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/CGCall.cpp
76ed61788e88ab1f6345fd3611e1a618f1c334e3 26-Mar-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Fix uninitialized read of CalleeWithThisReturn.

CalleeWithThisReturn can be left initialized if HasThisReturn() is false.
This change reverses the order of checks in EmitFunctionEpilog such that
CalleeWithThisReturn is only examined when it has a meaningful value.

Found with MemorySanitizer.


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

rdar://13195034

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.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/CGCall.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/CGCall.cpp
4159f05999914fc1d342131f64c1c37f00059288 13-Mar-2013 Bill Wendling <isanbard@gmail.com> Have these attriubtes set to 'true' or 'false'.

The back-end cannot differentiate between functions that are from a .ll file and
those generated from the front-end. We cannot then take the non-precense of
these attributes as a "false" value. Have the front-end explicitly set the value
to 'true' or 'false' depending upon what is actually set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d436c99c47f7fca4e60077aa7e38cab7c1323f08 10-Mar-2013 Guy Benyei <guy.benyei@intel.com> Fix indirect byval passing of records in address spaced memory. Allocate memory on stack, and memcpy the actual value before the call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
3c5cd15da59d084ee441ac1512907a73f0e1f2bd 05-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't emit calls to virtual [[noreturn]] functions as noreturn; overrides of a
[[noreturn]] function are not required to also be [[noreturn]]. We still emit
calls to virtual __attribute__((noreturn)) functions as noreturn; unlike GCC,
we do require overriders to also be noreturn for that attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
be9e8bfef6ee7f81ea30e9d358101b4f8d560c6b 28-Feb-2013 Bill Wendling <isanbard@gmail.com> Add more of the command line options as attribute flags.

These can be easily queried by the back-end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
899245792776dd219a3c36eb19b42272e270bc0c 27-Feb-2013 Bill Wendling <isanbard@gmail.com> Reapply r176133 with testcase fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d9365d2d71d591024c420b52afdfc8b4ed0c55db 27-Feb-2013 Bill Wendling <isanbard@gmail.com> Temporarily revert r176133 until testcases are modified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2693c323c0cf146da439719d6d31f321ac70add0 27-Feb-2013 Bill Wendling <isanbard@gmail.com> Don't set the -target-cpu and -target-features attributes just now.

This is causing some problems with some of the builders. It's non-trivial to
reset the target's features.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
c2833111020d7a672bb4b547799fcd87ea4f8fb5 25-Feb-2013 Anna Zaks <ganna@apple.com> Revert "Add more attributes from the command line to functions."

This reverts commit 176009.

The commit is a likely cause of several buildbot failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d620e09c13b1ca32434ce440abf5bb0f3d0979c5 25-Feb-2013 Bill Wendling <isanbard@gmail.com> Add more attributes from the command line to functions.

This is an ongoing process. Any command line option which a back-end cares about
should be added here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176009 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
7728cddd7866fadd07f1191eee40985e3cdbc6bf 23-Feb-2013 Peter Collingbourne <peter@pcc.me.uk> Revert r175912, "Add support for coldcc to clang" at John's request.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
93e4bff1a30d2ac37461943599efd59f04a5c00f 22-Feb-2013 Bill Wendling <isanbard@gmail.com> Make sure we apply attributes to correct places.

Some attributes make sense only on the function or on the call site, but not
both. Make this distinction here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
4c67aa96401b67b5200e701cff87485067ab0792 22-Feb-2013 Peter Collingbourne <peter@pcc.me.uk> Add support for coldcc to clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
94236e7393d5cd4acbc5f0b503d23bbe78d9aeec 22-Feb-2013 Bill Wendling <isanbard@gmail.com> Apply the 'nobuiltin' attribute to call sites when the user specifies `-fno-builtin' on the command line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
3f5fcd2d584ef5cfbb4328466c0812754a2e1e7a 19-Feb-2013 Bill Wendling <isanbard@gmail.com> Temporarily revert r175471 for more review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ea9cde636fa182a1a132db9d3749f288e78d86eb 19-Feb-2013 Bill Wendling <isanbard@gmail.com> Add a 'no-builtin' attribute if we do not want to simplify calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
c0dcc2d7beaeb6a80c0c7d69086b4c8894b662a0 15-Feb-2013 Bill Wendling <isanbard@gmail.com> Add the 'target-cpu' and 'target-features' attributes to functions.

The back-end will use these values to reconfigure code generation for different
features.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
b9316b3829372c71f2f54d54a9748285f7ffe3fd 14-Feb-2013 Bill Wendling <isanbard@gmail.com> Revert accidental commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
e1092dfee2bbcc2243421c553bca488880324280 14-Feb-2013 Bill Wendling <isanbard@gmail.com> Pass the target options through to code generation.

The code generation stuff is going to set attributes on the functions it
generates. To do that it needs the target options. Pass them through.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
7586a6e6b7d79d4be031d2d0d6a35d5996cd0db9 30-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled as
an attribute for consistency with our other noreturn mechanisms.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
b263bdf2954953cc7cca5d667eb01319ea0f72ec 27-Jan-2013 Bill Wendling <isanbard@gmail.com> Use the AttributeSet instead of AttributeWithIndex.

In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
89530e45729d300b39c7332d2ad20c3ea476ab94 23-Jan-2013 Bill Wendling <isanbard@gmail.com> Remove the last of uses that use the Attribute object as a collection of attributes.

Collections of attributes are handled via the AttributeSet class now. This
finally frees us up to make significant changes to how attributes are structured.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
cd8ab51a44e80625d84126780b0d85a7732e25af 17-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 semantics for [[noreturn]] attribute. This required splitting
it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their
semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as
affecting the function type, whereas [[noreturn]] does not).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
01ad954459c9bdd21e55290859643e334e9c70f4 30-Dec-2012 Bill Wendling <isanbard@gmail.com> Remove the Function::getFnAttributes method in favor of using the AttributeSet
directly.

This is in preparation for removing the use of the 'Attribute' class as a
collection of attributes. That will shift to the AttributeSet class instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
38980086c0f791e8c23cc882574f18e5b4a87db6 25-Dec-2012 Guy Benyei <guy.benyei@intel.com> Add intel_ocl_bicc calling convention as a function attribute to clang. The calling convention is already implemented in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.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/CGCall.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/CGCall.cpp
785b778203a474c6e4b9e17ae91cd2a358868877 08-Dec-2012 Bill Wendling <isanbard@gmail.com> s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
e56bb36e8eea89bae7dfe6eb6ea0455af126bf4a 07-Dec-2012 John McCall <rjmccall@apple.com> Fix the required args count for variadic blocks.

We were emitting calls to blocks as if all arguments were
required --- i.e. with signature (A,B,C,D,...) rather than
(A,B,...). This patch fixes that and accounts for the
implicit block-context argument as a required argument.
In addition, this patch changes the function type under which
we call unprototyped functions on platforms like x86-64 that
guarantee compatibility of variadic functions with unprototyped
function types; previously we would always call such functions
under the LLVM type T (...)*, but now we will call them under
the type T (A,B,C,D,...)*. This last change should have no
material effect except for making the type conventions more
explicit; it was a side-effect of the most convenient implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
8b8a09e496fbed361d4c8e9e8cc259454a094258 29-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Merge function types in C.

Among other differences, GCC accepts

typedef int IA[];
typedef int A10[10];
static A10 *f(void);
static IA *f(void);
void g(void) {
(void)sizeof(*f());
}

but clang used to reject it with:

invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []')

The intention of c99's 6.2.7 seems to be that we should use the composite type
and accept as gcc does.

Doing the type merging required some extra fixes:
* Use the type from the function type in initializations, even if an parameter
is available.
* Fix the merging of the noreturn attribute in function types.
* Make CodeGen handle the fact that an parameter type can be different from
the corresponding type in the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
060f34d6d12a851faa9463da522f7dff1104d0e1 28-Nov-2012 Manman Ren <mren@apple.com> ABI: comments from Eli on r168820.

rdar://12723368


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f51c61c78e8487061b6a434286488fa3e5b919e5 28-Nov-2012 Manman Ren <mren@apple.com> ABI: modify CreateCoercedLoad and CreateCoercedStore to not use load or store of
the original parameter or return type.

Since we do not accurately represent the data fields of a union, we should not
directly load or store a union type.

As an exmple, if we have i8,i8, i32, i32 as one field type and i32,i32 as
another field type, the first field type will be chosen to represent the union.
If we load with the union's type, the 3rd byte and the 4th byte will be skipped.

rdar://12723368


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
82c458ea76bf8f0981e3d1b5070c0b0e5878d784 28-Nov-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C arc: load of a __weak object happens via call to
objc_loadWeak. This retains and autorelease the weakly-refereced
object. This hidden autorelease sometimes makes __weak variable alive even
after the weak reference is erased, because the object is still referenced
by an autorelease pool. This patch overcomes this behavior by loading a
weak object via call to objc_loadWeakRetained(), followng it by objc_release
at appropriate place, thereby removing the hidden autorelease. // rdar://10849570


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168740 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
dd851595cb9123558c9029efdadb1b4be9881a3d 20-Nov-2012 Bill Wendling <isanbard@gmail.com> Update method calls to the new interface re r168354.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
356d9cccd7fa455fc609d4c9eac330e380d832d7 30-Oct-2012 Quentin Colombet <qcolombet@apple.com> Change ForceSizeOpt attribute into MinSize attribute

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
9046768d2c7e21a7933c8158664550a866fcdd74 26-Oct-2012 Quentin Colombet <qcolombet@apple.com> Oz optimization level sets ForceSizeOpt attribute for each function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
e4aeeaae8ee93ad5e07c646046c650d594f2775e 24-Oct-2012 Rafael Espindola <rafael.espindola@gmail.com> Add padding inreg registers to cause llvm to skip ecx when needed with
the x86_fastcallcc calling convention.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0b4cc950c54c8dd2de51587ef48446de670fa012 19-Oct-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix handling of the regparm attribute in the presence of classes with copy
constructors.

When I first moved regparm support to TargetInfo.cpp I tried to isolate it
in classifyArgumentTypeWithReg, but it is actually a lot easier to flip the
code around and check for regparm at the end of the decision tree.

Without this refactoring classifyArgumentTypeWithReg would have to duplicate
the logic about when to use non-byval indirect arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
263366f9241366f29ba65b703120f302490c39ff 17-Oct-2012 Derek Schuff <dschuff@google.com> Add pnaclcall convention to Native Client targets.

Because PNaCl bitcode must be target-independent, it uses some
different bitcode representations from other targets (e.g. byval and
sret for structures). This means that without additional type
information, it cannot meet some native ABI requirements for some
targets (e.g. passing structures containing unions by value on
x86-64). To allow generation of code which uses the correct native
ABIs, we also support triples such as x86_64-nacl, which uses
target-dependent IR (as opposed to le32-nacl, which uses byval and
sret).

To allow interoperation between the two types of code, this patch adds
a calling convention attribute to be used in code compiled with the
target-dependent triple, which will generate code using the le32-style
bitcode. This calling convention does not need to be explicitly
supported in the backend because it determines bitcode representation
rather than native conventions (the backend just needs to undersand
how to handle byval and sret for the Native Client OS).

This patch implements __attribute__((pnaclcall)) to generate calls in
bitcode according to the le32 bitcode conventions, an attribute which
is accepted by any Native Client target, but issues a warning
otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a6375560645177168099f1a1d96be8fa4718aa8e 16-Oct-2012 Bill Wendling <isanbard@gmail.com> Use the Attributes::get method which takes an AttrVal value directly to simplify the code a bit. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0d5833921cc728bc1d2e45fbaf7b3e11cddbf99d 15-Oct-2012 Bill Wendling <isanbard@gmail.com> Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
75d37b493e2282f993a19a166bd573b03a7535af 15-Oct-2012 Bill Wendling <isanbard@gmail.com> Use enum values instead of magic numbers for indexing into the attribute list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
50e6b18f99c45b31e6216ab221f6b3911b24fa1f 15-Oct-2012 Bill Wendling <isanbard@gmail.com> Attributes Rewrite

Convert the uses of the Attributes class over to the new format. The
Attributes::get method call now takes an LLVM context so that the attributes
object can be uniquified and stored.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f82232c8b73851337b83b954ba1292cf6475c7c5 10-Oct-2012 Chandler Carruth <chandlerc@gmail.com> Apply the same fundamental fix for PR14048 as was applied for PR11905.

The issue arises when coercing to/from types of different sizes. We need
to be certain that the allocation on either end has sufficient room for
the coerced type. When it doesn't, we need to make room, copy across,
and then proceed. PR11905 handled the case of storing function arguments
back into allocas in the function prolog, this patch handles the case of
setting up the function arguments in a call expression.

This is actually significantly simpler than the fix for PR11905. It ends
up being a trivial change to create a temporary alloca when the source
is too small and memcpy across. This should preserve the compile-time
fast-isel benefits of doing gep+load sequences and avoiding FCAs.

Reviewed by Benjamin and Evgeniy (who fixed PR11905).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
603571a2d6daca43162bf1d9469baf919697c00a 10-Oct-2012 Bill Wendling <isanbard@gmail.com> Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change
intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
db9eeb88d8e63a28f0b7d623011ec286a84f68a3 21-Sep-2012 Bill Wendling <isanbard@gmail.com> Update for encapsulating the "construct*AlignmentFromInt" methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f9fdcc0531ca53651c1d7d0877290e232cb5468d 08-Sep-2012 John McCall <rjmccall@apple.com> In ARC, if we're emitting assembly markers for calls to
objc_retainAutoreleasedReturnValue, we need to also be killing
them during return peepholing. Make sure we recognize an
intervening bitcast, but more importantly, assert if we can't
find the asm marker at all. rdar://problem/12133032

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
b48280ba1790122cd3fa6e17c88ecd6a4571a4eb 31-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Handle functions with struct arguments or return types and the regparm
attribute. It is a variation of the x86_64 ABI:

* A struct returned indirectly uses the first register argument to pass the
pointer.
* Floats, Doubles and structs containing only one of them are not passed in
registers.
* Other structs are split into registers if they fit on the remaining ones.
Otherwise they are passed in memory.
* When a struct doesn't fit it still consumes the registers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
bd9b65ae534cb11aa39737aa43ab82bb29e078f6 31-Jul-2012 John McCall <rjmccall@apple.com> Don't crash *or* insert a bogus autorelease when emitting a
this-adjustment thunk in ARC++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8f88a1dcc57cfe8580eb1558a783ad8499bfe8e0 12-Jul-2012 Timur Iskhodzhanov <timurrrr@google.com> [Windows] Use thiscall as the default calling convention for class methods. PR12785

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0f3d0970dcdf6cf17550b86838dff12813968dbc 07-Jul-2012 John McCall <rjmccall@apple.com> Distinguish more carefully between free functions and C++ instance methods
in the ABI arrangement, and leave a hook behind so that we can easily
tweak CCs on platforms that use different CCs by default for C++
instance methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
7e0dc76b175414ecdd9a6b26bdb548281da8bffd 22-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt> revert CodeGen support for the alloc_size attribute until we finish the design of a more generic metadata node

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

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

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a61ab0521576e9e9e90cd2d482f8684e6070a93c 28-May-2012 Chris Lattner <sabre@nondot.org> adjust to mainline llvm API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
976f266b969e03ef08b37b5f4aaf013f48f1ba6e 25-May-2012 Nuno Lopes <nunoplopes@sapo.pt> fix codegen support for alloc_size attribute for static C++ methods
add test case for C++ codegen

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2813420dd3be04fc0c44074c3f1af1aada83ad99 25-May-2012 Nuno Lopes <nunoplopes@sapo.pt> add CodeGen support for the alloc_size attribute

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
262bc18e32500558af7cb0afa205b34bd37bafed 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove the ref/value inconsistency in filter_decl_iterator.

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

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

(reviewed by Richard Smith)

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


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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
08212631e15a17157368af03180018601b31fb4d 16-Mar-2012 Bill Wendling <isanbard@gmail.com> When "low alignment" is specified, then set the alignment of the aggregate's
store to 1. This allows code-gen to select a more appropriate alignment. If left
to zero, an alignment greater than the alignment of the pointer may be selected,
causing code-gen to use instructions which require an alignment greater than the
pointer guarantees.
<rdar://problem/11043589>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
de5d3c717684f3821b8db58037bc7140acf134aa 17-Feb-2012 John McCall <rjmccall@apple.com> Whether an argument is required (in contrast with being an
optional argument passed through the variadic ellipsis)
potentially affects how we need to lower it. Propagate
this information down to the various getFunctionInfo(...)
overloads on CodeGenTypes. Furthermore, rename those
overloads to clarify their distinct purposes, and make
sure we're calling the right one in the right place.
This has a nice side-effect of making it easier to construct
a function type, since the 'variadic' bit is no longer
separable.

This shouldn't really change anything for our existing
platforms, with one minor exception --- we should now call
variadic ObjC methods with the ... in the "right place"
(see the test case), which I guess matters for anyone
running GNUStep on MIPS. Mostly it's just a substantial
clean-up.

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

This is a part of rdar://10803830.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a6ce20ea10b1788ed1f266d5809a7ac2bca7bf1b 10-Feb-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Fix function prolog codegen whe coerce-to type is a struct.

This changes function prolog in such a way as to avoid out-of-bounds
stack store in the case when coerce-to type has a larger storage size
than the real argument type.

Fixes PR11905.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
77fe6cd58f284bcc0130b8fd90018d7e5a960b56 29-Jan-2012 John McCall <rjmccall@apple.com> When emitting an ARC epilogue that looks like a return of 'self',
kill the retain from the return site.

This has the workaround nature. It's badness all around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f48f79636d5506d15784c2c2fa8a02086adda40a 29-Jan-2012 John McCall <rjmccall@apple.com> Get a little bit smarter about killing off the ReturnValue alloca
in the presence of straight-line cleanups. This is a simple but
important case, particularly for ARC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
c891666f477bfee387c10a429038eb6d98e9d175 20-Jan-2012 Kostya Serebryany <kcc@google.com> use llvm:Attributes instead of unsigned

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
4ba3fd45bb134e4a5119f297537adce4e7ef4a39 09-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Move the piece of code up that skips the padding argument. Without this change,
padding insertion will not work if the coerced type is not a structure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f0cc2087b18c48b17c2f647c88a3e7eef19285fd 07-Jan-2012 Akira Hatanaka <ahatanaka@mips.com> Add field PaddingType to ABIArgInfo which specifies the type of padding that
is inserted before the real argument. Padding is needed to ensure the backend
reads from or writes to the correct argument slots when the original alignment
of a byval structure is unavailable due to flattening.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
51f512090530807e2c80f9411cc262025820c859 03-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Add a utility to get a RValue for a given LValue for an aggregate; switch a few places over to it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2871020b2d30b8a642c02280be849a7924426222 27-Nov-2011 Rafael Espindola <rafael.espindola@gmail.com> Add inreg attributes to reference arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ca3d3fcabaa0d7255e9a778ef468daa6e052b211 15-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix crash in calling convention code expanding an struct with a complex member.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
1bb94a417a53a524784ec98f232acc70e62370b2 03-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix alignment on alloca's for parameters using ABIArgInfo::Expand.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
eea64802558cc398571938b1f28cda1d4fa79ec3 31-Oct-2011 Anders Carlsson <andersca@mac.com> In x86_64, when calling an Objective-C method that returns a _Complex long double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
bfcacd9e00015b9b8e1a027639000fdbaa398194 22-Oct-2011 Bob Wilson <bob.wilson@apple.com> Fix a typo that completely broke the expansion of complex arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6700415542121e2cb7d867728046ffa21e402019 12-Oct-2011 Rafael Espindola <rafael.espindola@gmail.com> Add returns_twice to functions that are known to return twice. This implements
the same behavior of gcc by keeping the attribute out of the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f87cced71a955dca5731e7b28bc182e4824c0355 03-Oct-2011 Rafael Espindola <rafael.espindola@gmail.com> Propagate __attribute__((returns_twice)) from C to IL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
491306a83c4f0f49f95a3bcbca8580cb98a91c7a 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow getting all source locations of selector identifiers in a ObjCMethodDecl.

Instead of always storing all source locations for the selector identifiers
we check whether all the identifiers are in a "standard" position; "standard" position is

-Immediately before the arguments: -(id)first:(int)x second:(int)y;
-With a space between the arguments: -(id)first: (int)x second: (int)y;
-For nullary selectors, immediately before ';': -(void)release;

In such cases we infer the locations instead of storing them.

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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
cec52f0623d57f090e3477941acebe4932fa7abd 26-Aug-2011 John McCall <rjmccall@apple.com> Slight optimization enabled by the previous assert:
emit all gl-value arguments as reference bindings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8affed5107ea79bf4d429770d2873e9c7288255e 26-Aug-2011 John McCall <rjmccall@apple.com> Assert that a call argument is a gl-value iff the parameter is a reference type.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
041087caec03e8855770695d3eabc0feb031f6ed 16-Aug-2011 Eric Christopher <echristo@apple.com> 'pure' and 'const' functions should also be marked nounwind. Migrate
test over from llvm/test/FrontendC++ and update others to account for
the change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
194f06a476d299a7a70e5ff1d152f5895dc0a76c 03-Aug-2011 Bob Wilson <bob.wilson@apple.com> Handle "homogeneous aggregates" as required by the ARM AAPCS-VFP ABI.

A homogeneous aggregate is an aggregate data structure where after flattening
any nesting there are 1 to 4 elements of the same base type that is either a
float, double, or Neon vector. All Neon vectors of the same size, either 64
or 128 bits, are treated as equivalent for this purpose. When using the
AAPCS-VFP ABI, check for homogeneous aggregates and pass them as arguments by
expanding them into a sequence of their base types. This requires extending
the existing support for expanded arguments to handle not only structs, but
also constant arrays and complex types.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
b13eab95e1a5bb1e78706179f15f8416e9fbcfbf 20-Jul-2011 Chris Lattner <sabre@nondot.org> fix rdar://9780211 - Clang crashes with an assertion failure building WKView.mm from WebKit

This is something of a hack, the problem is as follows:

1. we instantiate both copied of RetainPtr with the two different argument types
(an id and protocol-qualified id).
2. We refer to the ctor of one of the instantiations when introducing global "x",
this causes us to emit an llvm::Function for a prototype whose "this" has type
"RetainPtr<id<bork> >*".
3. We refer to the ctor of the other instantiation when introducing global "y",
however, because it *mangles to the same name as the other ctor* we just use
a bitcasted version of the llvm::Function we previously emitted.
4. We emit deferred declarations, causing us to emit the body of the ctor, however
the body we emit is for RetainPtr<id>, which expects its 'this' to have an IR
type of "RetainPtr<id>*".

Because of the mangling collision, we don't have this case, and explode.

This is really some sort of weird AST invariant violation or something, but hey
a bitcast makes the pain go away.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d26c07142710790b820a66245939668f62eaf2d9 15-Jul-2011 Chris Lattner <sabre@nondot.org> protect some calls to ConvertType when a function info is under construction
to prevent recursive compilation problems. This fixes a failure of CodeGen/decl.c
on x86-32 targets that don't fill in the coerce-to type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
71305cc81bd379ddb8aa0d49e268267383202ca9 15-Jul-2011 Chris Lattner <sabre@nondot.org> Enhance the IR type lowering code to be much smarter about recursively lowering
types. Fore xample, we used to lower:

struct bar { int a; };
struct foo {
void (*FP)(struct bar);
} G;

to:

%struct.foo = type { {}* }

since the function pointer would cause recursive translation of bar and
we didn't know if that would get us into trouble. We are now smart enough
to know that it is fine, so we get this type instead:

%struct.foo = type { void (i32)* }

Codegen still needs to be prepared for uncooperative types at any place,
which is why I let the maximally uncooperative code sit around for awhile to
help shake out the bugs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6af13f3a3538d6c075a6282a7f393c26ee1563c7 13-Jul-2011 Chris Lattner <sabre@nondot.org> PR10337 reminds me that calls return values, lets handle them just
like arguments. Thanks PR10337! :)


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
21ca1fdb25c2bb98721e569aacd10e8b684dd51a 12-Jul-2011 Chris Lattner <sabre@nondot.org> fix PR10335 by watching out for IR type compatibility in call argument lists.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
708554498595e047cc53e366c91cc063fcc1c5bc 12-Jul-2011 Chris Lattner <sabre@nondot.org> add some aggressive assertions that call arguments match up to callee
expectations in EmitCall. Next patch will take this further.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
be5f332c4d9eb302cd020047c382aa133ad59501 10-Jul-2011 Chris Lattner <sabre@nondot.org> how about we initialize RecursionState.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f742eb0196e1b25c0b71e91da4a2b856d16a1dab 10-Jul-2011 Chris Lattner <sabre@nondot.org> Rename CGT::VerifyFuncTypeComplete to isFuncTypeConvertible since
it is a predicate, not an action. Change the return type to be a bool,
not the incomplete member. Enhace it to detect the recursive compilation
case, allowing us to compile Eli's testcase on llvmdev:

struct T {
struct T (*p)(void);
} t;

into:

%struct.T = type { {}* }

@t = common global %struct.T zeroinitializer, align 8




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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
97cb5a4a21866610227963fc3dcce9d89b2f7990 16-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Per Chris's suggestion, simplify code using llvm::getOrEnforceKnownAlignment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
70cbd2a2a07ff3109adb2d584f7ad4b5cce88af2 15-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Fix a regression from r132957 involving complex integers. (Fixes failures on gcc-testsuite bot.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ea5e4da116aae0eb932d32b73e7cec2f04932248 14-Jun-2011 Eli Friedman <eli.friedman@gmail.com> The LLVM IR representation of byval arguments has a rather strange property: if the alignment of an argument to a call is less than the specified byval alignment for that argument, there is no way to specify the alignment of the implied copy. Therefore, we must ensure that the alignment of the argument is at least the byval alignment. To do this, we have to mess with the alignment of relevant alloca's in some cases, and insert a copy that conceptually shouldn't be necessary in some cases.

This patch tries relatively hard to avoid creating an extra copy if it can be avoided (see test3 in the included testcase), but it is not possible to avoid in some cases (like test2 in the included testcase).

rdar://9483886



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
55d484802f3e27930317739efc5f5956b78aac25 26-May-2011 Eli Friedman <eli.friedman@gmail.com> Skip extra copy from aggregate where it isn't necessary; rdar://problem/8139919 . This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0.

Originally r130717, but was backed out due to an ObjC regression.



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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
badea57d1db45caa95e71a256f4f4cf94fe20451 17-May-2011 Eli Friedman <eli.friedman@gmail.com> For calls returning first-class aggregates, store by element instead of creating aggregate stores in common cases. This is more friendly to fast-isel.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
42e06119496e84e74cfc60230b18fcb53b35eb1c 15-May-2011 John McCall <rjmccall@apple.com> More killing of std::vector.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6f0877744517fa1daf3ac9d2e5c63c9acfcfa562 07-May-2011 Douglas Gregor <dgregor@apple.com> Revert r130717, which caused a regression (<rdar://problem/9402621>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
b5a03b6217cd6c3eecdc1aa4df03060cf51ac942 02-May-2011 Eli Friedman <eli.friedman@gmail.com> Skip extra copy from aggregate where it isn't necessary; rdar://problem/8139919 . This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
c6d07821c529bb95e4cf072e49b736c5142f1786 02-May-2011 Eli Friedman <eli.friedman@gmail.com> Switch CallArgList from an std::pair to a new CallArg struct (which will eventually gain more members). Working towards modifying call emission to avoid unnecessary copies.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
414d8967e1d760ea1e19a4aca96b13777a8cf8c5 14-Apr-2011 Anton Korobeynikov <asl@math.spbu.ru> Implement ARM pcs attribute. Basically it's another way of calling convention selection (AAPCS or
AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86.

In particular, all library functions should always be AAPCS regardless of floating point ABI used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a49218e17bcbb1acde0245773173e2c0c42f4f19 09-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR8369: make __attribute((regparm(0))) work correctly. Original patch by
pageexec@freemail.hu, tweaks by me.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8026f6d82f7fa544bc0453714fe94bca62a1196e 13-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Instead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
60618fa7f88d5162bb5b40988b6b38d4d75d6fc6 12-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Propagate the new exception information to FunctionProtoType.
Change the interface to expose the new information and deal with the enormous fallout.
Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications.
Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
c95a8fcb0a2f4148f1852c52c34ad3a1771d7e5d 10-Mar-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/CodeGen/CGCall.cpp: Don't invoke multiple Builder.CreateBitCast() on Builder.CreateMemCpy. Or we would see sideeffect incompatibility among gcc and clang.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
41ba26701de859128ebe48a957c286e5dc01475f 02-Mar-2011 Devang Patel <dpatel@apple.com> revert r126858.


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

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


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
c0ddef23136368ce1bd882f7edd43591c8f30aa6 01-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> objc IRGen for Next runtime message API.
The prototype for objc_msgSend() is technically variadic -
`id objc_msgSend(id, SEL, ...)`.
But all method calls should use a prototype that matches the method,
not the prototype for objc_msgSend itself().
// rdar://9048030


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
7f6890ebb874cc16320259daef50f1b4cfdc47d5 10-Feb-2011 Daniel Dunbar <daniel@zuster.org> Fix family-friendly-o, tsk tsk.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125293 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
17d3fea677753e6e3e82ffe2cbdeccbf5f2e7497 09-Feb-2011 Daniel Dunbar <daniel@zuster.org> Driver/Frontend: Wire up -mregparm=.

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

Radar 8945514.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
fe71008c2764768f25478b16c1802755189ed7c9 19-Jan-2011 Ken Dyck <kd@kendyck.com> Replace calls to getTypeSize() and getTypeAlign() with their 'InChars'
counterparts where char units are needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
9cac4942b920d4c5514e71949e3062ed626bfbdf 19-Oct-2010 Michael J. Spencer <bigcheesegs@gmail.com> Fix Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
cf3b6f2504596812db1fcef0df8ce5b3449c4aac 16-Sep-2010 Daniel Dunbar <daniel@zuster.org> IRgen/ABI: Add support for realigning structures which are passed by indirect
reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
52fc314e1b5e1baee6305067cf831763d02bd243 03-Sep-2010 Dawn Perchik <dawn@burble.org> Add symantic support for the Pascal calling convention via
"__attribute((pascal))" or "__pascal" (and "_pascal" under
-fborland-extensions). Support still needs to be added to llvm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
fc4002872864e3c29c896000519ae989b6fdb7dd 03-Sep-2010 John McCall <rjmccall@apple.com> Re-commit r112916 with an additional fix for the self-host failures.
I've audited the remaining getFunctionInfo call sites.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2b8d60dfdfbbf19f6e2dcfb5c438f8eda8a7ecb4 03-Sep-2010 John McCall <rjmccall@apple.com> Revert r112916, it's breaking selfhost pretty badly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
52968abd2aaf36f17d9858581563bf80475fb178 03-Sep-2010 John McCall <rjmccall@apple.com> It's not safe to use the generic CXXMethodDecl overload of CGT::getFunctionInfo
to set up a destructor call, because ABIs can tweak these conventions.
Fixes rdar://problem/8386802.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
79c3928d816f317dd27109fb92e7d190c1c68329 21-Aug-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Switch more MakeAddr() users to MakeAddrLValue; this time for calls which were previously not computing the qualifier list. In most cases, I don't think it matters, but I believe this is conservatively more correct / consistent.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
117e3f4cd4d6ea41c3202da8729f94168c5c8239 30-Jul-2010 Chris Lattner <sabre@nondot.org> fix PR5179 and correctly fix PR5831 to not miscompile.

The X86-64 ABI code didn't handle the case when a struct
would get classified and turn up as "NoClass INTEGER" for
example. This is perfectly possible when the first slot
is all padding (e.g. due to empty base classes). In this
situation, the first 8-byte doesn't take a register at all,
only the second 8-byte does.

This fixes this by enhancing the x86-64 abi stuff to allow
and handle this case, reverts the broken fix for PR5831,
and enhances the target independent stuff to be able to
handle an argument value in registers being accessed at an
offset from the memory value.

This is the last x86-64 calling convention related miscompile
that I'm aware of.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
1ed72678b41c6038b08f48cb7e2a7b61e2dd9179 29-Jul-2010 Chris Lattner <sabre@nondot.org> fix a builder, why didn't clang++ catch this?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
800588fd230d2c37ddce8fbf4a3881352715d700 29-Jul-2010 Chris Lattner <sabre@nondot.org> Kill off the 'coerce' ABI passing form. Now 'direct' and 'extend' always
have a "coerce to" type which often matches the default lowering of Clang
type to LLVM IR type, but the coerce case can be handled by making them
not be the same.

This simplifies things and fixes issues where X86-64 abi lowering would
return coerce after making preferred types exactly match up. This caused
us to compile:

typedef float v4f32 __attribute__((__vector_size__(16)));
v4f32 foo(v4f32 X) {
return X+X;
}

into this code at -O0:

define <4 x float> @foo(<4 x float> %X.coerce) nounwind {
entry:
%retval = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2]
%coerce = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2]
%X.addr = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3]
store <4 x float> %X.coerce, <4 x float>* %coerce
%X = load <4 x float>* %coerce ; <<4 x float>> [#uses=1]
store <4 x float> %X, <4 x float>* %X.addr
%tmp = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1]
%tmp1 = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1]
%add = fadd <4 x float> %tmp, %tmp1 ; <<4 x float>> [#uses=1]
store <4 x float> %add, <4 x float>* %retval
%0 = load <4 x float>* %retval ; <<4 x float>> [#uses=1]
ret <4 x float> %0
}

Now we get:

define <4 x float> @foo(<4 x float> %X) nounwind {
entry:
%X.addr = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3]
store <4 x float> %X, <4 x float>* %X.addr
%tmp = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1]
%tmp1 = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1]
%add = fadd <4 x float> %tmp, %tmp1 ; <<4 x float>> [#uses=1]
ret <4 x float> %add
}

This implements rdar://8248065



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ee5dcd064a811edc90f6c1fb31a837b6c961fed7 29-Jul-2010 Chris Lattner <sabre@nondot.org> dissolve some more complexity: make the x86-64 abi lowering code
compute its own preferred types instead of having CGT compute
them then pass them (circuituously) down into ABIInfo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a3c109bbf6e198f463fbe204da4d25b40dab65c4 29-Jul-2010 Chris Lattner <sabre@nondot.org> now that ABIInfo depends on CGT, it has trivial access to such
things as TargetData, ASTContext, LLVMContext etc. Stop passing
them through so many APIs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2eb9cdd5922c6fe48af185bee1988dabb5bd644e 29-Jul-2010 Chris Lattner <sabre@nondot.org> tidy up


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
deabde24e1712253e483a46d24c0e10f25ebba99 28-Jul-2010 Chris Lattner <sabre@nondot.org> some cleanups and get alignments correct for various coerce cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f60946222721d9ba3c059563935c17b84703187a 23-Jul-2010 Douglas Gregor <dgregor@apple.com> Vectors are not integer types, so the type system should not classify
them as such. Type::is(Signed|Unsigned|)IntegerType() now return false
for vector types, and new functions
has(Signed|Unsigned|)IntegerRepresentation() cover integer types and
vector-of-integer types. This fixes a bunch of latent bugs.

Patch from Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d3f265d68b2609a29acddb6de0b7e3b4dbe16204 21-Jul-2010 Devang Patel <dpatel@apple.com> Fix regression caused by r108911.
Do not override known debug loc with unknown debug loc.
This is tested by sections.exp in gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
4751a53c5e5fed4bf2271e29cae7411c93a77df7 20-Jul-2010 Dan Gohman <gohman@apple.com> Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,
avoiding MDNode overhead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
dacf9dda17346c628fdd8c5df53c681738db0dc5 15-Jul-2010 Daniel Dunbar <daniel@zuster.org> CodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosing
whether to use objc_msgSend_fpret; the choice is target dependent, not Obj-C ABI
dependent.
- <rdar://problem/8139758> arm objc _objc_msgSend_fpret bug

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
9c0c1f333ab8f5a3da055b99ee94778689face17 08-Jul-2010 John McCall <rjmccall@apple.com> Mark calls to 'throw()' functions as nounwind, and mark the functions nounwind
as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
9282688a296b306c4ae2d115f55101647056d1da 05-Jul-2010 Chris Lattner <sabre@nondot.org> Generate fewer first class aggregate values for other
coerce cases (e.g. {double,int}) which avoids fastisel
bailing out at -O0.


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

This fixes PR7567


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a9fa85841102e81daaa23650d89b120fe9dacedc 01-Jul-2010 Chris Lattner <sabre@nondot.org> fix rdar://8147692 - yet another crash due to my abi work.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
21fcc8f01246b91dbef65e7af85f2f0947758a00 30-Jun-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Fix debug info regression in r106970; when we eliminate the return value
store make sure to move the debug metadata from the store (which is actual
'return' statement location) to the return instruction (which otherwise would
have the function end location as its debug info).
- Tested by gdb test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107322 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
bcaedaed309ce453a992fdeef4a4c908cc7d9dfb 30-Jun-2010 Chris Lattner <sabre@nondot.org> Reapply:
r107173, "fix PR7519: after thrashing around and remembering how all this stuff"
r107216, "fix PR7523, which was caused by the ABI code calling ConvertType instead"

This includes a fix to make ConvertTypeForMem handle the "recursive" case, and call
it as such when lowering function types which have an indirect result.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107310 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
7bbe03d8ae0772d89f6539d073dd43e49268a42c 30-Jun-2010 Daniel Dunbar <daniel@zuster.org> Revert r107173, "fix PR7519: after thrashing around and remembering how all this stuff", it broke bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107232 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a9e05156438dc3f0ef1067ffce80037d9333e022 30-Jun-2010 Daniel Dunbar <daniel@zuster.org> Revert r107216, "fix PR7523, which was caused by the ABI code calling ConvertType instead", it is part of a boostrap breaking sequence.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f1d5d8a7f217119063232f72f74cdba4bebbd714 30-Jun-2010 Chris Lattner <sabre@nondot.org> fix PR7523, which was caused by the ABI code calling ConvertType instead
of ConvertTypeRecursive when it needed to in a few cases, causing pointer
types to get resolved at the wrong time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
bb52114f81e8829fe29a9a0faa49e8b2157206cc 29-Jun-2010 Chris Lattner <sabre@nondot.org> relax the CGFunctionInfo::CGFunctionInfo ctor to allow any sequence
of CanQualTypes to be passed in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
376fe5e7800dface235c5382b39d77790d39dfa7 29-Jun-2010 Chris Lattner <sabre@nondot.org> fix PR7519: after thrashing around and remembering how all this stuff
works, the fix is quite simple: just make sure to call ConvertTypeRecursive
when the function type being lowered is in the midst of ConvertType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ce93399f26f23735b8e291321f18ad54f64cb58a 29-Jun-2010 Chris Lattner <sabre@nondot.org> minor cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8640cd6bf077e007fdb9bc8c9c5e319f7d70da96 29-Jun-2010 Chris Lattner <sabre@nondot.org> Pass the LLVM IR version of argument types down into computeInfo.
This is somewhat annoying to do this at this level, but it avoids
having ABIInfo know depend on CodeGenTypes for a hint.

Nothing is using this yet, so no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
225e286110bcc8b7b1ff8b35f0d51a10a158b18c 29-Jun-2010 Chris Lattner <sabre@nondot.org> add IR names to coerced arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
309c59f6d3a4fd883fdf87334271df2c55338aae 29-Jun-2010 Chris Lattner <sabre@nondot.org> make the argument passing stuff in the FCA case smarter still, by
avoiding making the FCA at all when the types exactly line up. For
example, before we made:

%struct.DeclGroup = type { i64, i64 }

define i64 @_Z3foo9DeclGroup(i64, i64) nounwind {
entry:
%D = alloca %struct.DeclGroup, align 8 ; <%struct.DeclGroup*> [#uses=3]
%2 = insertvalue %struct.DeclGroup undef, i64 %0, 0 ; <%struct.DeclGroup> [#uses=1]
%3 = insertvalue %struct.DeclGroup %2, i64 %1, 1 ; <%struct.DeclGroup> [#uses=1]
store %struct.DeclGroup %3, %struct.DeclGroup* %D
%tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1]
%tmp1 = load i64* %tmp ; <i64> [#uses=1]
%tmp2 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 1 ; <i64*> [#uses=1]
%tmp3 = load i64* %tmp2 ; <i64> [#uses=1]
%add = add nsw i64 %tmp1, %tmp3 ; <i64> [#uses=1]
ret i64 %add
}

... which has the pointless insertvalue, which fastisel hates, now we
make:

%struct.DeclGroup = type { i64, i64 }

define i64 @_Z3foo9DeclGroup(i64, i64) nounwind {
entry:
%D = alloca %struct.DeclGroup, align 8 ; <%struct.DeclGroup*> [#uses=4]
%2 = getelementptr %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1]
store i64 %0, i64* %2
%3 = getelementptr %struct.DeclGroup* %D, i32 0, i32 1 ; <i64*> [#uses=1]
store i64 %1, i64* %3
%tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1]
%tmp1 = load i64* %tmp ; <i64> [#uses=1]
%tmp2 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 1 ; <i64*> [#uses=1]
%tmp3 = load i64* %tmp2 ; <i64> [#uses=1]
%add = add nsw i64 %tmp1, %tmp3 ; <i64> [#uses=1]
ret i64 %add
}

This only kicks in when x86-64 abi lowering decides it likes us.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ce70016434ff82a29a60ef82894d934b8a23f23d 29-Jun-2010 Chris Lattner <sabre@nondot.org> Change CGCall to handle the "coerce" case where the coerce-to type
is a FCA to pass each of the elements as individual scalars. This
produces code fast isel is less likely to reject and is easier on
the optimizers.

For example, before we would compile:
struct DeclGroup { long NumDecls; char * Y; };
char * foo(DeclGroup D) {
return D.NumDecls+D.Y;
}

to:
%struct.DeclGroup = type { i64, i64 }

define i64 @_Z3foo9DeclGroup(%struct.DeclGroup) nounwind {
entry:
%D = alloca %struct.DeclGroup, align 8 ; <%struct.DeclGroup*> [#uses=3]
store %struct.DeclGroup %0, %struct.DeclGroup* %D, align 1
%tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1]
%tmp1 = load i64* %tmp ; <i64> [#uses=1]
%tmp2 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 1 ; <i64*> [#uses=1]
%tmp3 = load i64* %tmp2 ; <i64> [#uses=1]
%add = add nsw i64 %tmp1, %tmp3 ; <i64> [#uses=1]
ret i64 %add
}

Now we get:

%0 = type { i64, i64 }
%struct.DeclGroup = type { i64, i8* }

define i8* @_Z3foo9DeclGroup(i64, i64) nounwind {
entry:
%D = alloca %struct.DeclGroup, align 8 ; <%struct.DeclGroup*> [#uses=3]
%2 = insertvalue %0 undef, i64 %0, 0 ; <%0> [#uses=1]
%3 = insertvalue %0 %2, i64 %1, 1 ; <%0> [#uses=1]
%4 = bitcast %struct.DeclGroup* %D to %0* ; <%0*> [#uses=1]
store %0 %3, %0* %4, align 1
%tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i64*> [#uses=1]
%tmp1 = load i64* %tmp ; <i64> [#uses=1]
%tmp2 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 1 ; <i8**> [#uses=1]
%tmp3 = load i8** %tmp2 ; <i8*> [#uses=1]
%add.ptr = getelementptr inbounds i8* %tmp3, i64 %tmp1 ; <i8*> [#uses=1]
ret i8* %add.ptr
}

Elimination of the FCA inside the function is still-to-come.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6ae0069f5db96b8ed5adc598d576e695e5ac4134 29-Jun-2010 Chris Lattner <sabre@nondot.org> make the trivial forms of CreateCoerced{Load|Store} trivial.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
6d11cdbde41aa847369db85369b2ce5f82515b06 27-Jun-2010 Chris Lattner <sabre@nondot.org> If coercing something from int or pointer type to int or pointer type
(potentially after unwrapping it from a struct) do it without going through
memory. We now compile:

struct DeclGroup {
unsigned NumDecls;
};

int foo(DeclGroup D) {
return D.NumDecls;
}

into:

%struct.DeclGroup = type { i32 }

define i32 @_Z3foo9DeclGroup(i64) nounwind ssp noredzone {
entry:
%D = alloca %struct.DeclGroup, align 4 ; <%struct.DeclGroup*> [#uses=2]
%coerce.dive = getelementptr %struct.DeclGroup* %D, i32 0, i32 0 ; <i32*> [#uses=1]
%coerce.val.ii = trunc i64 %0 to i32 ; <i32> [#uses=1]
store i32 %coerce.val.ii, i32* %coerce.dive
%tmp = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i32*> [#uses=1]
%tmp1 = load i32* %tmp ; <i32> [#uses=1]
ret i32 %tmp1
}

instead of:

%struct.DeclGroup = type { i32 }

define i32 @_Z3foo9DeclGroup(i64) nounwind ssp noredzone {
entry:
%D = alloca %struct.DeclGroup, align 4 ; <%struct.DeclGroup*> [#uses=2]
%tmp = alloca i64 ; <i64*> [#uses=2]
%coerce.dive = getelementptr %struct.DeclGroup* %D, i32 0, i32 0 ; <i32*> [#uses=1]
store i64 %0, i64* %tmp
%1 = bitcast i64* %tmp to i32* ; <i32*> [#uses=1]
%2 = load i32* %1, align 1 ; <i32> [#uses=1]
store i32 %2, i32* %coerce.dive
%tmp1 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i32*> [#uses=1]
%tmp2 = load i32* %tmp1 ; <i32> [#uses=1]
ret i32 %tmp2
}

... which is quite a bit less terrifying.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
e7bb777caf478ac8b096bd6a0c14d78ea8b2f5be 27-Jun-2010 Chris Lattner <sabre@nondot.org> Same patch as the previous on the store side. Before we compiled this:

struct DeclGroup {
unsigned NumDecls;
};

int foo(DeclGroup D) {
return D.NumDecls;
}

to:

%struct.DeclGroup = type { i32 }

define i32 @_Z3foo9DeclGroup(i64) nounwind ssp noredzone {
entry:
%D = alloca %struct.DeclGroup, align 4 ; <%struct.DeclGroup*> [#uses=2]
%tmp = alloca i64 ; <i64*> [#uses=2]
store i64 %0, i64* %tmp
%1 = bitcast i64* %tmp to %struct.DeclGroup* ; <%struct.DeclGroup*> [#uses=1]
%2 = load %struct.DeclGroup* %1, align 1 ; <%struct.DeclGroup> [#uses=1]
store %struct.DeclGroup %2, %struct.DeclGroup* %D
%tmp1 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i32*> [#uses=1]
%tmp2 = load i32* %tmp1 ; <i32> [#uses=1]
ret i32 %tmp2
}

which caused fast isel bailouts due to the FCA load/store of %2. Now
we generate this just blissful code:

%struct.DeclGroup = type { i32 }

define i32 @_Z3foo9DeclGroup(i64) nounwind ssp noredzone {
entry:
%D = alloca %struct.DeclGroup, align 4 ; <%struct.DeclGroup*> [#uses=2]
%tmp = alloca i64 ; <i64*> [#uses=2]
%coerce.dive = getelementptr %struct.DeclGroup* %D, i32 0, i32 0 ; <i32*> [#uses=1]
store i64 %0, i64* %tmp
%1 = bitcast i64* %tmp to i32* ; <i32*> [#uses=1]
%2 = load i32* %1, align 1 ; <i32> [#uses=1]
store i32 %2, i32* %coerce.dive
%tmp1 = getelementptr inbounds %struct.DeclGroup* %D, i32 0, i32 0 ; <i32*> [#uses=1]
%tmp2 = load i32* %tmp1 ; <i32> [#uses=1]
ret i32 %tmp2
}

This avoids fastisel bailing out and is groundwork for future patch.
This reduces bailouts on CGStmt.ll to 911 from 935.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
08dd2a0e4c6b3c7cb601e5053eb02cb7d084f87e 27-Jun-2010 Chris Lattner <sabre@nondot.org> improve CreateCoercedLoad a bit to generate slightly less awful
IR when handling X86-64 by-value struct stuff. For example, we
use to compile this:

struct DeclGroup {
unsigned NumDecls;
};

int foo(DeclGroup D);
void bar(DeclGroup *D) {
foo(*D);
}

into:

define void @_Z3barP9DeclGroup(%struct.DeclGroup* %D) ssp nounwind {
entry:
%D.addr = alloca %struct.DeclGroup*, align 8 ; <%struct.DeclGroup**> [#uses=2]
%agg.tmp = alloca %struct.DeclGroup, align 4 ; <%struct.DeclGroup*> [#uses=2]
%tmp3 = alloca i64 ; <i64*> [#uses=2]
store %struct.DeclGroup* %D, %struct.DeclGroup** %D.addr
%tmp = load %struct.DeclGroup** %D.addr ; <%struct.DeclGroup*> [#uses=1]
%tmp1 = bitcast %struct.DeclGroup* %agg.tmp to i8* ; <i8*> [#uses=1]
%tmp2 = bitcast %struct.DeclGroup* %tmp to i8* ; <i8*> [#uses=1]
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 4, i32 4, i1 false)
%0 = bitcast i64* %tmp3 to %struct.DeclGroup* ; <%struct.DeclGroup*> [#uses=1]
%1 = load %struct.DeclGroup* %agg.tmp ; <%struct.DeclGroup> [#uses=1]
store %struct.DeclGroup %1, %struct.DeclGroup* %0, align 1
%2 = load i64* %tmp3 ; <i64> [#uses=1]
call void @_Z3foo9DeclGroup(i64 %2)
ret void
}

which would cause fastisel to bail out due to the first class aggregate load %1. With
this patch we now compile it into the (still awful):

define void @_Z3barP9DeclGroup(%struct.DeclGroup* %D) nounwind ssp noredzone {
entry:
%D.addr = alloca %struct.DeclGroup*, align 8 ; <%struct.DeclGroup**> [#uses=2]
%agg.tmp = alloca %struct.DeclGroup, align 4 ; <%struct.DeclGroup*> [#uses=2]
%tmp3 = alloca i64 ; <i64*> [#uses=2]
store %struct.DeclGroup* %D, %struct.DeclGroup** %D.addr
%tmp = load %struct.DeclGroup** %D.addr ; <%struct.DeclGroup*> [#uses=1]
%tmp1 = bitcast %struct.DeclGroup* %agg.tmp to i8* ; <i8*> [#uses=1]
%tmp2 = bitcast %struct.DeclGroup* %tmp to i8* ; <i8*> [#uses=1]
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp1, i8* %tmp2, i64 4, i32 4, i1 false)
%coerce.dive = getelementptr %struct.DeclGroup* %agg.tmp, i32 0, i32 0 ; <i32*> [#uses=1]
%0 = bitcast i64* %tmp3 to i32* ; <i32*> [#uses=1]
%1 = load i32* %coerce.dive ; <i32> [#uses=1]
store i32 %1, i32* %0, align 1
%2 = load i64* %tmp3 ; <i64> [#uses=1]
%call = call i32 @_Z3foo9DeclGroup(i64 %2) noredzone ; <i32> [#uses=0]
ret void
}

which doesn't bail out. On CGStmt.ll, this reduces fastisel bail outs from 958 to 935,
and is the precursor of better things to come.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
c6e6dd2611bccd0d4df1f83a92bebb9b5d139b7d 27-Jun-2010 Chris Lattner <sabre@nondot.org> reduce indentation


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
06057cef0bcd7804e80f3ce2bbe352178396c715 16-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Move CodeGenOptions.h *back* into Frontend. This should have been done when the
dependency edge was reversed such that CodeGen depends on Frontend.


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

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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f813a2c03fcb05381b3252010435f557eb6b3cde 18-May-2010 Douglas Gregor <dgregor@apple.com> Add support for Microsoft's __thiscall, from Steven Watanabe!


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



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
fb97cf24158aa7f1fd74374052f99733ef331bb9 20-Apr-2010 Chris Lattner <sabre@nondot.org> don't slap noalias attribute on stret result arguments.
This mirror's Dan's patch for llvm-gcc in r97989, and
fixes the miscompilation in PR6525. There is some contention
over whether this is the right thing to do, but it is the
conservative answer and demonstrably fixes a miscompilation.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
425ef72306d4ff6b3698b744353e5f0e56b4b884 31-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Remember the regparm attribute in FunctionType::ExtInfo.
Fixes PR3782.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
d8e10d26b5a24257fe13c289b653fd450326eeff 27-Mar-2010 John McCall <rjmccall@apple.com> When mapping restrict to noalias, look for 'restrict' on the parameter variable
instead of the canonical parameter type (which has correctly dropped all such
direct qualifiers). Fixes PR6695.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ead608af31b6c9abeae1ca6d0b75094dac4641c0 26-Feb-2010 John McCall <rjmccall@apple.com> Use the power of types to track down another canonicalization bug in
the ABI-computation interface. Fixes <rdar://problem/7691046>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0b0ef0a70b8010c66fad2603e4423ef1c1dc7015 24-Feb-2010 John McCall <rjmccall@apple.com> Canonicalize parameter and return types before computing ABI info. Eliminates
a common source of oddities and, in theory, removes some redundant ABI
computations. Also fixes a miscompile I introduced yesterday by refactoring
some code and causing a slightly different code path to be taken that
didn't perform *parameter* type canonicalization, just normal type
canonicalization; this in turn caused a bit of ABI code to misfire because
it was looking for 'double' or 'float' but received 'const float'.



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

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

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

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



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

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

PR6240.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
b2bcf1c176b200b36f371e189ce22f93c86cdf45 06-Feb-2010 Anders Carlsson <andersca@mac.com> Use the correct function info for constructors when applying function attributes. Fixes PR6245.

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

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

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
079b49550dafc5eefa27c58817e613fd1b1c4309 07-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> implement PR5274: mark 'restrict' parameters as noalias

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.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/CGCall.cpp
ecf282b0486873309fd58ec4d3ec0dbf983b33d4 24-Nov-2009 Anders Carlsson <andersca@mac.com> It is common for vtables to contain pointers to functions that have either incomplete return types or incomplete argument types.

Handle this by returning the llvm::OpaqueType for those cases, which CodeGenModule::GetOrCreateLLVMFunction knows about, and treats as being an "incomplete function".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89736 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
fd015353a3c4f528216276f25df5b4d464d7a0cd 16-Nov-2009 Anders Carlsson <andersca@mac.com> The ssp and sspreq function attributes should only be applied to function definitions, not declarations or calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2811ccf48d6d898c42cc4cfad37abedb36236d20 12-Nov-2009 Chandler Carruth <chandlerc@gmail.com> Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.
This resolves the layering violation where CodeGen depended on Frontend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
7ab1c3ebd02c31bfa1333cc51de1261c1499d6f7 27-Oct-2009 Daniel Dunbar <daniel@zuster.org> Set OptimizeForSize LLVM function attribute with -Os.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84456 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ffbb15e54a6dc120087003d1e42448b8705bd58a 05-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> Use new predicates for some type equality tests.


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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
0a8f847e97f40cce51dc69051b964732333dc028 16-Sep-2009 Anders Carlsson <andersca@mac.com> x86-64 ABI: If a type is a C++ record with either a non-trivial destructor or a non-trivial copy constructor, it should be passed in a pointer. Daniel, plz review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ca6408c3176783f0b29da4679a08512aa05f0c73 12-Sep-2009 Daniel Dunbar <daniel@zuster.org> Change CodeGenModule::ConstructTypeAttributes to return the calling convention
to use, and allow the ABI implementation to override the calling convention.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8a9f3fd8bb14a64a31a29bf5cf5376b643218b71 12-Sep-2009 Daniel Dunbar <daniel@zuster.org> Set the calling convention based on the CGFunctionInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
bac7c250c9b098ee3d637c8ed77da62e860d9244 12-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add CallingConvention argument to CGFunctionInfo.
- Currently unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.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/CGCall.cpp
76168e289ca4b307259e3bc9b3353f03b05bb6b9 09-Aug-2009 Ryan Flynn <pizza@parseerror.com> map previously ignored __attribute((malloc)) to noalias attribute of llvm function's return

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
0ab9a25101efeb56620a99118bee116ae052a7ca 02-Aug-2009 Daniel Dunbar <daniel@zuster.org> Use Twine instead of utostr


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
0cfeb63f532973777f6fe75d3468c3acad4adfe3 28-Jul-2009 John McCall <rjmccall@apple.com> Allow functions to be marked "implicit return zero" and so mark main().
Codegen by initializing the return value with its LLVM type's null value.



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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
4ebe3e4c811a376c423a544f5e76ee2e96533324 29-Jun-2009 Bill Wendling <isanbard@gmail.com> Make the StackProtector bitfield use enums instead of obscure numbers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74414 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
45483f7a1b3e57b4603b141bee80596b2d4dd443 28-Jun-2009 Bill Wendling <isanbard@gmail.com> Add stack protector support to clang. This generates the 'ssp' and 'sspreq'
function attributes. There are predefined macros that are defined when stack
protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with
-fstack-protector-all.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74405 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d6bebbfd510f3b495795b88aafd10ead3cb211e9 23-Jun-2009 Chris Lattner <sabre@nondot.org> fix PR4423.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
5db7ae59bb0115ccc420ff1d688abc8706559b57 13-Jun-2009 Chris Lattner <sabre@nondot.org> Fix PR4372, another case where non-prototyped functions can prevent
always_inline from working.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
cc6fa88666ca2f287df4a600eb31a4087bab9c13 06-Jun-2009 Anton Korobeynikov <asl@math.spbu.ru> Add new ABIArgInfo kind: Extend. This allows target to implement its own argument
zero/sign extension logic (consider, e.g. target has only 64 bit registers and thus
i32's should be extended as well).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
c4a59eb306efeb4bffa3cefecd1e6392fc5c4144 06-Jun-2009 Anton Korobeynikov <asl@math.spbu.ru> Factor out TargetABIInfo stuff into separate file. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
acebb397fa5d63835a0de9cee144987057ec1333 06-Jun-2009 Devang Patel <dpatel@apple.com> Set function Attribute::NoImplicitFloat appropriately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
fdf4986c4c75514df428ed71d5942252f18e129b 05-Jun-2009 Daniel Dunbar <daniel@zuster.org> ABI handling: Fix nasty thinko where IRgen could generate an out-of-bounds read
when generating a coercion for ABI handling purposes.
- This may only manifest itself when building at -O0, but the practical effect
is that other arguments may get clobbered.

- <rdar://problem/6930451> [irgen] ABI coercion clobbers other arguments


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72932 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
24095dad88dd9d48aa16afa6416417073af251b5 05-Jun-2009 Devang Patel <dpatel@apple.com> Set function attribute llvm::Attribute::NoRedZone appropriately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
86e13eeb65397f7b64173523a40c742b2702364b 26-May-2009 Daniel Dunbar <daniel@zuster.org> When trying to pass an argument on the stack, assume LLVM will do the right
thing for non-aggregate types.
- Otherwise we unnecessarily pin values to the stack and currently end up
triggering a backend bug in one case.

- This loose cooperation with LLVM to implement the ABI is pretty ugly.

- <rdar://problem/6918722> [irgen] clang miscompile of many pointer varargs on
x86-64


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
3a5f5c57e0a262207f7cb721a60df3676ab5209f 22-May-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Account for sret parameters consuming an integer register.
- PR4242.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6857d9d43b082ae825c29cca80f2f6b7c3aa4e5f 22-May-2009 Torok Edwin <edwintorok@gmail.com> Set correct calling convention even if there is a bitcast in the way.
This attempts to fix PR4239.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
beaaccd8e2a8748f77b66e2b330fb9136937e14c 21-May-2009 Jay Foad <jay.foad@gmail.com> Use v.data() instead of &v[0] when SmallVector v might be empty.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ac8d6298a8ae9276412d8c054957dfa65a69eb14 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Clean up some unnecessary includes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
7ef455be9beb7a755d815bfbdc38d55d1ce59b86 13-May-2009 Daniel Dunbar <daniel@zuster.org> ABI handling: Fix invalid assertion, it is possible for a valid
coercion to be specified which truncates padding bits. It would be
nice to still have the assert, but we don't have any API call for the
unpadding size of a type yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
3eb67ca786ef75bad43d30349c7334b921ba0dbc 12-May-2009 Chris Lattner <sabre@nondot.org> static methods don't get this pointers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
836a0641ba4109b2c1254eec247ba4d2731bc2b7 12-May-2009 Daniel Dunbar <daniel@zuster.org> Darwin x86-32 ABI: Now that structure passing is farther along, we
don't need special treatment for unions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
20e95c5eb400c864bbd4421624fdf7b25ce70f56 12-May-2009 Daniel Dunbar <daniel@zuster.org> x86-64 ABI: clang incorrectly passes union { long double, float } in
register.
- Merge algorithm was returning MEMORY as it should.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71556 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
cc401dc651a91f53f9f9a39956732be8f537e7fa 12-May-2009 Daniel Dunbar <daniel@zuster.org> Darwin x86-32: Multi-dimensional arrays were not handled correctly,
spotted by Eli!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
573b907e8ba3b74fc69cddaf63496c7bb5994196 11-May-2009 Daniel Dunbar <daniel@zuster.org> Darwin x86_32: Treat records with unnamed bit-fields as "empty".


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8236bf1800641d1c296579e25218f68f74c5caac 09-May-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Ignore padding bit-fields during classification.
- {return-types,single-args}-{32,64} pass the first 1k ABI tests with
bit-fields enabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71272 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2e0011650fe149bf55916c6f25558bf9bfebf537 08-May-2009 Daniel Dunbar <daniel@zuster.org> Darwin x86_32: When coercing a "single element" structure, make sure
to use a wide enough type. This might be wider than the "single
element"'s type in the presence of padding bit-fields.
- Darwin x86_32 now passes the first 1k ABI tests with bit-field
generation enabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
fcab2ca966d5176839f8698535e0d807bd968629 08-May-2009 Daniel Dunbar <daniel@zuster.org> Darwin x86_32: Ignore padding bit-fields when looking for "single
element" structures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
eedd292ea0cf2216ff16d3490147323489102e3a 08-May-2009 Daniel Dunbar <daniel@zuster.org> Darwin x86_32: Improve bit-field handling for returning records.
- This turns out to be a no-op now that most of the handling for
everything else is in place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f7fff322debe0b7256fe4dbc1103a3c2b43c379a 08-May-2009 Daniel Dunbar <daniel@zuster.org> Darwin x86_32: Ignore arrays of empty structures inside records.
- This eliminates 5/1000 failures on return-types-32, on the current
ABITest config.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ae69e005a9072a30262dfe87360b034d4b8e45f2 30-Apr-2009 Chris Lattner <sabre@nondot.org> fix i128 to return in 2 64-bit registers (rax/rdx on x86-64)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2df9ced9fd1e8c7d7b38443db07e0e811de22571 30-Apr-2009 Chris Lattner <sabre@nondot.org> initial support for __[u]int128_t, which should be basically
compatible with VC++ and GCC. The codegen/mangling angle hasn't
been fully ironed out yet. Note that we accept int128_t even in
32-bit mode, unlike gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8e03444e924665d4d90f5cfc0624c815256e0309 27-Apr-2009 Daniel Dunbar <daniel@zuster.org> x86-32 ABI: Fix crash on return of structure with flexible array
member.

Also, spell bitfield more consistently as bit-field.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
9a901bb63990574ff0bcc12ff851d7a71cff8ddb 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
70aa5f9e9f3ec77327f701562efc53d7c36c5843 21-Apr-2009 Sanjiv Gupta <sanjiv.gupta@microchip.com> Pass and return aggregate types directly to function calls.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
64c2e0762628eba26c100642521b6100c2515cc5 11-Apr-2009 Daniel Dunbar <daniel@zuster.org> Don't set both readnone and readonly.


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


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a17d7ccc2ed77e321855990e180f2a34ec304bfc 08-Apr-2009 Anders Carlsson <andersca@mac.com> Don't assume that a block always has a FunctionProtoType. Fixes rdar://6768379.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
5529b24500a9cdeb45e9d4482ceb54fc39a7471e 06-Apr-2009 Anders Carlsson <andersca@mac.com> Add a getFunctionInfo that takes a BlockPointerType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
1102f4282ceb430dbc9fcedb9dd2ad25898a09e8 04-Apr-2009 Anton Korobeynikov <asl@math.spbu.ru> Basic support for regparm codegen

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68414 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f6f8ae561ef78af169cbd2c067cae7ee4b2044e9 04-Apr-2009 Anders Carlsson <andersca@mac.com> Add a getFunctionInfo that takes a CXXMethodDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
cf6bde343ff5653744ca782e04d5a9c54b260042 01-Apr-2009 Daniel Dunbar <daniel@zuster.org> x86-32 Darwin ABI: Handle small structures correctly.
- Small structures are returned in a register if:
1. They fit nicely in a register.
2. All fields fit nicely in a register.
(more or less)

- We now pass the first 5000 ABITests if unions are disabled.

- <rdar://problem/6497882> [irgen] x86-32 ABI compatibility with
small structs


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
dfc6b80ee13a9102cd67e0b2398fa999eebcbf8e 01-Apr-2009 Daniel Dunbar <daniel@zuster.org> x86-32 Darwin ABI: Single element arrays can be part of "single
element structures", which have different ABI rules.
- Current return-arguments-32 status is: 1 out of 1000 failures (-7)

- Also, vectors inside "single element structs" require special
handling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
360431660b2245a109f5c6870729126dbcdea254 01-Apr-2009 Daniel Dunbar <daniel@zuster.org> x86-32 Darwin ABI: Handle direct return of vectors.
- Current return-arguments-32 status is: 8 out of 1000 failures (-7)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
5bde6f41506535ddaf6e9ff60bd1488db8ded952 31-Mar-2009 Daniel Dunbar <daniel@zuster.org> x86_32 Darwin ABI: Treat empty unions like empty structures.
- Current return-arguments-32 status: 15/1000 failures


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a027ea94d6e4f501f9fa690ac728f68c62612a7d 29-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Initial implementation of ARM ABI. Mostly untested. Note that I'm not
really intending to take ownership of this; I wrote this mostly because
I was curious about how the ARM ABI works. It should be a decent start,
though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
9fd58e85d59f8244c7ba289ae4f9b4f5e0b4c98f 24-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix the ABI convention for struct returns on x86 outside of Darwin.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
3403084886b3d0fc23eee2b5708f0ac0329423e0 22-Mar-2009 Chris Lattner <sabre@nondot.org> don't set the name of a call instruction to "call" in release-asserts
build. This shaves another 3% off.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0ac86f0821a2ba7ae09793fee4451bef99e9b2f3 18-Mar-2009 Daniel Dunbar <daniel@zuster.org> PR3835: Interaction with ABI structure passing can inhibit
readnone/readonly attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
e06a75f4c8ea30b6a99d5aa1dce5feda64da09c6 11-Mar-2009 Daniel Dunbar <daniel@zuster.org> x86_32 ABI: Don't try and expand structures with bitfields.
- This is an ABI incompatiblity, but this is not likely to be a huge
deal in practice. For now we at least generate self consistent code
instead of crashing.
- <rdar://problem/6657601> x86-32 ABI: Bitfields in small structures
are not passed correctly


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
4a77edb3f0fabc8e214a3d5636c4d0aff031645c 10-Mar-2009 Daniel Dunbar <daniel@zuster.org> Remove some now-unneeded calls to llvm::errs().flush().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
100f402451da96f74ea58b1f49fc53b4fa149a57 06-Mar-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Handle long double in union when upper eightbyte results
in a lone X87 class.
- PR3735.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d14151d5f52fa9048d41d7539299243e05755ec4 02-Mar-2009 Daniel Dunbar <daniel@zuster.org> Cleanup handling of function attributes in calls.
- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.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/CGCall.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/CGCall.cpp
708762b66a813543078a6d1c4fc2b69ee4361ec7 26-Feb-2009 Anders Carlsson <andersca@mac.com> Classify enum types correctly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
9a8c2e9051b3db6909e5efa872ad60ff524be065 26-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Qualified id types are passed as pointers.
- <rdar://problem/6622451> Bad x86_64 code gen for message call taking one argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0334a4ec63c43ac9ed13faa30fbcfc7697828ffd 25-Feb-2009 Daniel Dunbar <daniel@zuster.org> Temporarily disable clearing of insert point (to indicate unreachable
code) when calling noreturn functions; general expression emission
isn't ready to do the right thing in all cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65473 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
245f5534a520c23e703fd239632273c551be50b3 22-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Actually, we can always pass things we want to pass in
memory using Indirect; this was a holdover from when CGCall wasn't as
robust.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
775e43b3bd47d9388608a57f7489982d3024fdc5 22-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Make sure to pass vectors that we want to pass in memory
as byval. Otherwise LLVM will have its own opinion about where to put
things.

We now pass all gcc dg.compat tests on x86_64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
e28099bf301ad8b0b77cb11f94caad3c38d97dda 22-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Pass 32-bit vectors as Integer to match gcc. We don't care
about these much but <2 x i16> shows up in the gcc test suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0af9929e1ba8e5b9ae0a8999439736d249599bbe 22-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Classify <1 x i64> as INTEGER (match gcc not llvm-gcc).

Also, make sure to pass <1 x i64> as i64 (not <1 x i64>, which doesn't
quite work yet in the backend).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f4fe0f082f21048c0777ad5aeac04a5a94db1f46 20-Feb-2009 Daniel Dunbar <daniel@zuster.org> Take advantage of noreturn attribute to add unreachable instruction &
clear insertion point. The rest of IRgen should theoretically take
advantage of this to avoid emitting dead code. Theory != Practice.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2073216a1075767b5d25c23d1462b7034686d94d 20-Feb-2009 Chris Lattner <sabre@nondot.org> switch ObjCMethodDecl's parameter list from being explicitly managed to an ObjCList.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
570f0cf734f321b902eb18dd1b07f53543f0a393 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> i386 ABI: Offset computation in va_arg was incorrect for sizeof(Ty)>4.

We are down to only failing gcc.dg/compat/vector-[12] (8 tests total).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
90dafa1638edaffbba4b50f504d1470428a2d25d 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Fix thinko in computation of bound for "passed in SSE regs" test.

Two more gcc/x86_64 failures down.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f231346438e61e59ff7b72d5ecbd58b6ae484211 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: "is passed in regs" computation for va_arg was broken for
things passed in mixed registers.

This knocks out 8 x86_64 failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
3e030b4c04546229c81449fde66f71b23b3fc550 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Two bug fixes.
1. Return of _Complex long double used wrong type.

2. va_arg of types passed in two SSE registers didn't account for
extra space in register save area.

Down to 18 failures on gcc/compat/x86_64. Combined 32/64 results are:
--
=== gcc Summary ===

# of expected passes 1292
# of unexpected failures 34
# of unsupported tests 2
--


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6e53e9b8795022ed08d5e59b8d78b2c616c2ef9a 17-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Fix assert on return of _Complex long double.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
dd81d44fac2631e6ca9fe1f52366aea0f51b03e1 17-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Implement classification for bit-fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
c5bcee4dce79458c4f490490c71619e06cbde357 17-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Handle va_arg arguments with alignment > 8.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
3327f6ead9362e5689674a4aaab5b7f23ea0dea3 14-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Need to use canonical types when comparing against
ASTContext types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
644f4c3fe4130c7be75d6191340ba8d857ba0730 14-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Pass simple types directly when possible. This is
important for both keeping the generated LLVM simple and for ensuring
that integer types are passed/promoted correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
55e5d8956be516d66db2196bd0ce3c30ebf5fbf0 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Support va_arg passed in mixed registers.
- Now at 1274 passes on gcc compat suite vs 1262.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
be9eb0937c667e2823971966adf960f86d3985d6 12-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64: Initial varargs support.
- Doesn't yet handle case where values are passed in mixed (general
purpose & floating point) registers; otherwise largely
functional. Code still needs some cleaning.

Fixes:
MultiSource/Applications/lua/lua
MultiSource/Applications/siod/siod
MultiSource/Applications/sqlite3/sqlite3
SingleSource/Regression/C/PR640
SingleSource/UnitTests/2003-07-09-SignedArgs
SingleSource/UnitTests/2007-03-02-VaCopy

gcc compat test suite results (Darwin x86-32 & -64):
--
# of expected passes 1262
# of unexpected failures 56
# of unresolved testcases 34
# of unsupported tests 2

Compare to: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090209/012050.html


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
3b4e9cd0655467f66332575b816a958d319e8ca6 10-Feb-2009 Daniel Dunbar <daniel@zuster.org> Tweak x86-64 ABI to allow reuse for vararg handling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
adc8bdd6ab6f4f90d16f696f16948e46acf66267 10-Feb-2009 Daniel Dunbar <daniel@zuster.org> ABI: Correctly handle load/store of values which have a different LLVM
memory representation (e.g., bool).
- This upgrades (downgrades) MultiSource/Applications/ClamAV/clamscan
to a miscompile and fixes
SingleSource/UnitTests/2003-05-31-CastToBool.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8b979d9e4c41fb67eb276996bdaa608fb4b11ccd 10-Feb-2009 Daniel Dunbar <daniel@zuster.org> Make sure to initialize local variables, even if they were ignored by
ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
386621f5e12f5db95af3b82250b08fdae3e3d321 07-Feb-2009 Daniel Dunbar <daniel@zuster.org> Set load/store alignment when doing ABI coercions.
- Currently, this is producing poor code, but we prefer correctness
to performance for now. Eventually we should be able to generally
avoid having to set the alignment when we control the alignment of
the alloca.

- This knocks out 33/1000 failures on my single argument ABI tests,
down to 22/1000 and 18 of these appear to be gcc bugs. Woot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2fbf2f547cf23c0dd89719c2b5c5d6c6f0fa469c 05-Feb-2009 Daniel Dunbar <daniel@zuster.org> Implement Direct ABIInfo semantics.
- No intended functionality change, this is essentially enabling
direct passing of complex and aggregate values, which no ABI is
using.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2969a0243b0939286a45d0ba58dd3e1de226ac60 05-Feb-2009 Daniel Dunbar <daniel@zuster.org> Simplify test for whether we need an alloca to hold an indirect return
value.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
1f7459814ed78067a8f0db3e1082b45ec89c16ab 05-Feb-2009 Daniel Dunbar <daniel@zuster.org> Implement ABI Indirect sematics for arguments.
- No intended functionality change, all current ABI implementations
were only using indirect for complex/aggregate types, which were
being passed indirectly with the Direct ABIInfo kind.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
11e383aa491a23ebd4a49688a09984c5e16a2e34 05-Feb-2009 Daniel Dunbar <daniel@zuster.org> Merge ABIInfo StructRet/ByVal into Indirect.
- No (intended) functionality change, the semantic changes are to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
13e81737a433b23f8c662d10d1d57356122a8caa 05-Feb-2009 Daniel Dunbar <daniel@zuster.org> Pull CodeGenFunction::GetUndefRValue() out of EmitUnsupportedRValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
3170c93d26bdc8b360c4ea3b1cedba50bbd818c1 05-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86-32: Use Ignore to avoid passing empty structs (instead of Expand).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ca008822e8ad5dd8b3ff598cf62e909966847a67 05-Feb-2009 Daniel Dunbar <daniel@zuster.org> Honor ByVal alignment. Patch by Nate Begeman!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63811 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
35e67d4387bbe3e7e17ee6b17eaa42eebb0eb9f1 05-Feb-2009 Daniel Dunbar <daniel@zuster.org> Unbreak CGFunctionInfo::Profile method and reenable caching of ABI
information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6f7279bf98e31356306386b2c200820a76b491cf 05-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add ABIArgInfo::dump()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
747f06a264931107dc9e0a5abcb494a45853d1fe 04-Feb-2009 Daniel Dunbar <daniel@zuster.org> Temporarily disable caching of ABI results; this is going horribly
wrong in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
4b5f0a4bd6645e87e5feae4be4675ce87d97b4a5 04-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add asserts that the function signature matches the other arguments provide
to CGCall functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8b29a387788bbb7a7c3b64c37473bc46299d2132 04-Feb-2009 Daniel Dunbar <daniel@zuster.org> Handle demotion of coerced arguments (as in void a(x) short x; { ... }).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
5a1be6e16ba306c349a3c3f80e9dce800976bc24 04-Feb-2009 Daniel Dunbar <daniel@zuster.org> Use ConvertTypeForMem when creating alloca for scalar argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
59e5a0e4f1b3a6f4ddcb0e902e98d8b3c9d10799 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Initial implementation of ABI compliant parameter passing.
- Now only 27/500 failures on ABITest single argument tests; from
350/500. :)
- As with return types, a large percentage of these are likely to be
gcc bugs, not yet reviewed.

Also, fix bug in handling of Ignore ABI type in argument lists.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
89c9d8e7f0700d27b1d93dc3832eb1af9b92c221 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> ABI handling: Implement coercion for argument types (in addition to
return types).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6bad2658b48264629db595f944a3fbe07f61b4e9 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> Change ABIInfo to compute information for a full signature at a time
(the main point of this restructing).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0bcc52114e37a8d152d9a05095ee7f7687c9aa94 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> Remove ABIArgInfo::Default kind, ABI is now responsible for specifying
acceptable kind with more precise semantics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63617 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
46327aaf031529be2cf8bb21bc76d7a5ae0d43cd 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add ABIArgInfo::Direct kind, which passes arguments using whatever the
native IRgen type is. This is like Default, but without any extra
semantics (like automatic tweaking of structures or void).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
5251afa21d3583f2740fd4f83659d008625a7260 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add two FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
b225be44aaab85a603e80dbe0eb3d81638b20d23 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> Always use CGFunctionInfo to access ABI information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
88c2fa96be989571b4afb6229f0ef5a3ef4450cb 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> Move ABIArgInfo into CGFunctionInfo, computed on creation.
- Still have to convert some consumers over.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
9eb5c6d3242d85359b2d669564c5e2826efb1931 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> Move ABIInfo/ABIArgInfo classes into ABIInfo.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
40a6be686e5d5bb4198f1affda574e8a4b3a7710 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> Memoize CGFunctionInfo construction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a0a99e02f5b2de3817706071077298ef040634fe 03-Feb-2009 Daniel Dunbar <daniel@zuster.org> Change CGFunctionInfo args iterator to not include the return type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.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/CGCall.cpp
bb36d331f439f49859efcfb4435c61762fbba6f9 02-Feb-2009 Daniel Dunbar <daniel@zuster.org> ABI handling API changes.
- Lift CGFunctionInfo creation up to callers of EmitCall.

- Move isVariadic bit out of CGFunctionInfo, take as argument to
GetFunctionType instead.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
275e10d62af4a129a8559253958296d8659684c9 02-Feb-2009 Daniel Dunbar <daniel@zuster.org> Shuffle some functions around, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
9a82b52ae83fa1c09266b2fa5f0375392f7d127f 02-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
36b5f5ee026b6725bff9c5b8faba635d7dfeeb7d 31-Jan-2009 Daniel Dunbar <daniel@zuster.org> Remove unused overload of GetFunctionType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63472 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6f6b0367ba358e4bc921a6b7b7438d829bcb778a 31-Jan-2009 Daniel Dunbar <daniel@zuster.org> Initialize CGFunctionInfo isVariadic bit correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
21a4f62fa4403f273e8dbb8afcaf9812a2f525c9 31-Jan-2009 Daniel Dunbar <daniel@zuster.org> Err, unbreak my previous "no functionality change commit", will fix properly later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
725ad31086e3d6c41afa10c43db44f2e7060a961 31-Jan-2009 Daniel Dunbar <daniel@zuster.org> Kill off CGCallInfo, always use CGFunctionInfo for encapsulating
function/call info.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
c450357c436c05aa02ef88d406de962d98ac50be 31-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Retool classification to compute lo & hi classifications
in terms of where the type resides in the containing object. This is a
more clear embodiement of the spec & fixes a merging issue with
unions. Down to 3/1000 failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
cdf920ed6c610e21fc899ada93370a68c900d180 30-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Fix more thinkos, straddling computation for complex was
computing in bytes not bits. We are now down to 22/1000 failures on
the return types tests, and 18 of those are gcc bugs I believe.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
71e62a92812eeb239926a2ce6cc371d8f50aa814 30-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Fix thinko in prev commit, 64-bit vectors should have SSE
class, not integer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d4cd1b07169c698bd003be102bd73a7da7e24b25 30-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Pass <1 x double> in memory. This is arguably wrong, but
matches gcc 4.2 (not llvm-gcc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
11a76ed8e34901f2b997896a8c0833c6c17bc586 30-Jan-2009 Daniel Dunbar <daniel@zuster.org> Remove testing -use-x86_64-abi option; current implementation is
robust enough for general use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
e33edf150adc44a34c5f6c8ed6109f6dcd2f70c6 30-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Split small vectors which cross an eightbyte boundary. Down to 33/500 return type failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8562ae74ae0ff0a64b46ef5ebea8e7ce0f76fa00 30-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Implement classification for arrays.
- This brings us down to an 8% failure rate on the first 500 return
types tests (from 12%).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
e620ecdd4104285e09fe585e90f720459b80259b 30-Jan-2009 Daniel Dunbar <daniel@zuster.org> Use uint64_t not unsigned for type sizes/offsets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f04d69bbb25eb681fff1a108f13f67c6ca70cf6a 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Handle fields / complex components which straddle
eightbyte boundaries.
- Getting harder to test now that we handle cases gcc & llvm-gcc get
wrong ( { _Complex char; _Complex int; } is a good example). :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
7f102f8c815a38e7df72b7d032c31529b98047f7 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Tweak merging algorithm so that we always bail early when
we see a Memory classification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63295 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
cc039fea2e985214e00387ce7404d358f56cf301 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> ABI: When emitting calls which return an ignored argument, make sure
to still return an RValue of the correct type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
99037e5a2118bc194251a8033a0885810bf61c95 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Implement classification for records.
- This is my best initial guess at what the "spec" means, although it is not
particularly clear on a number of points. Will refine through testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
b0e14f2a878c1a823341d34ca8f8fe60419fb9ef 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64: Support cases which map to returning multiple values in LLVM
(e.g., _Complex double -> { double, double } return).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
eac48dc189154eea5067310c5dd257dfe07c29aa 29-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64 ABI: Classify _Complex ints as integer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
7a6605d8be0fc30f1846657ee8133387b1b85296 27-Jan-2009 Daniel Dunbar <daniel@zuster.org> x86_64: Classify __m64 and __m128 "correctly".
- gcc appears to be classifying <1 x double> as INTEGER which is
odd. Will investigate later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
54d1ccbfcf19ddf39444f1b4018dd79487cc847b 27-Jan-2009 Daniel Dunbar <daniel@zuster.org> Implement support for coercion to wider types during ABI handling.
- Code quality is poor, but simple.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
11434925bf81c932c6c8fe3533bc0ba900d50dc2 26-Jan-2009 Daniel Dunbar <daniel@zuster.org> Add Ignore ABIArgInfo kind, for handling void & empty structures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6f3e7fac422fb0c50e1579edf49a797797c821cc 24-Jan-2009 Daniel Dunbar <daniel@zuster.org> Start filling in x86_64 ABI implementation.
- No functionality change, moved behind -use-x86_64-abi option until
it becomes non-experimental.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d4edfe4746c66d2ac452c8a8d7cac17192283e75 15-Jan-2009 Daniel Dunbar <daniel@zuster.org> Add dummy X86_64 ABIInfo implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f8d49f64ef6ab7e632717a31631fc289aab69428 09-Jan-2009 Douglas Gregor <dgregor@apple.com> Provide a new kind of iterator, the specific_decl_iterator, that
filters the decls seen by decl_iterator with two criteria: the dynamic
type of the declaration and a run-time predicate described by a member
function. This simplifies EnumDecl, RecordDecl, and ObjCContainerDecl
considerably. It has no measurable performance impact.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
3aea8cac3ec9ad03b1d2b002f38a0d42a70483c8 18-Dec-2008 Daniel Dunbar <daniel@zuster.org> Allow ABI to use StructRet even for scalar values.
- Update comment to reflect fact that StructRet is now supported for
any type (modulo LLVM support).

- No functionality change, no scalar types currently use this
feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
ad3d6917dabbdab3399ff8307240aad58247d2e3 25-Nov-2008 Anders Carlsson <andersca@mac.com> Handle returning complex types that get coerced. Fixes PR3131

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
39f34e97d6a468f0a7dfa5664c61217cffc65b74 24-Nov-2008 Chris Lattner <sabre@nondot.org> Migrate some stuff from NamedDecl::getName() to
NamedDecl::getNameAsString() to make it more explicit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59937 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
1385f8e826bf9b65a81888888de82cd6b82a7768 15-Nov-2008 Anders Carlsson <andersca@mac.com> Fix silly bug spotted by Daniel Dunbar

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59358 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0b685a5e4a473b180b7d2f433aaf09b91d3a0f78 15-Nov-2008 Anders Carlsson <andersca@mac.com> Handle complex return values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6b1da0ea19c12346192f5ea4d70872c13bfcc82a 13-Oct-2008 Daniel Dunbar <daniel@zuster.org> Lift out ABIInfo abstract base class.
- Currently still lives in CGCall.cpp but is intended to be the
target specific place for hooking ABI information.
- Select ABIInfo to use based on Target's prefix and pointer width.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
232eb7d33b96ad8f99de3b5ae840421b3a7c6cb7 06-Oct-2008 Anders Carlsson <andersca@mac.com> Implement support for the const and pure attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
a2c6912c416c2d9f79d18f3a88ab0ae2609286c3 27-Sep-2008 Devang Patel <dpatel@apple.com> Now Attributes are divided in three groups
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn

Return attributes use 0 as the index.
Function attributes use ~0U as the index.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
761d7f78e2dac7ea5f35828c2271e60d91e106ce 25-Sep-2008 Devang Patel <dpatel@apple.com> Large mechanical patch.

s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage
- to implement function notes as function attributes and
- to distinguish between function attributes and return value attributes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0fb1d15c37ed26dc24e477fd80df4b0f7872b4ed 24-Sep-2008 Devang Patel <dpatel@apple.com> Adjust whitespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
d0646bd7c11c12b34971b55e5c1bdd8439401b4c 24-Sep-2008 Devang Patel <dpatel@apple.com> s/ParamAttrsWithIndex/FnAttributeWithIndex/g

Rename to match changes done on llvm side.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
834af456588587194337bb32671fb9329e73a7f7 17-Sep-2008 Daniel Dunbar <daniel@zuster.org> Improve x86 ABI compatibility.
- Enables use of ABIArgInfo::Expand when needed. This greatly
improves our x86 ABI compatibility.

- As the infrastructure for target specific ABI handling isn't built
yet, this change means ABI compatibility on other platforms is once
again broken in a different way than before.

- Upcoming: Figure out how to refactor ABI handling into
targets. More documentation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56293 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
f035738e346da0a82538ab236aef218a27373635 17-Sep-2008 Daniel Dunbar <daniel@zuster.org> Drop CodeGenTypes parameter to classifyArgumentType.

Ensure that ABIArgInfo::Default implementation for aggregrate types
is sensible (StructRet on return and ByVal on arguments).

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
5627377df5439a1d3d46a4e4cef4ae44f84a322b 17-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add support for ABIArgInfo::Expand
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
8951dbd225580173193ec9db503d9d9844ff97d6 11-Sep-2008 Daniel Dunbar <daniel@zuster.org> Use ABIArgInfo for decisions about function arguments (not just return
value).
- Added ABIArgInfo::ByVal (mostly supported) and ABIArgInfo::Expand
(asserted out).

- Added classifyArgumentType which currently just uses
ABIArgInfo::Default or ByVal. This nearly matches old behavior, but
we now set ByVal in a few situations we may have left it off before
(on complex, for example).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
6660c8a4cc2115929d92be83bbc54c307002a321 11-Sep-2008 Daniel Dunbar <daniel@zuster.org> Bug fix, apply default argument promotion in message sends for which
no method declaration was found.
- This was allowing arrays to pass "by value" among other things.

Add assert in CodeGen that arguments cannot have array type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
639ffe47097d01249b98b7acd102aaad6697b43a 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Implement ABIArgType::Coerce support.
- As a test, enable basic usage for some common x86-32 cases. This
increases our x86-32 compliance (on other targets our compliance
will just be broken in a different way).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56051 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
62d5c1b5038cdaa4a887a03c37fe1e8d00166ea0 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add CodeGenTypes::GetFunctionType overload for getting the effective
type of a call.

Change NeXT runtime to use this instead of trying to bitcasting
internally (which doesn't respect the ABI).

Fix subtle bug, use of ConvertTypeRecursive instead of ConvertType is
bad inside GetFunctionType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
45c25ba11cbf8c9a461def5b03f6ee9481e06769 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Move FunctionType conversion into CGCall.cpp:
- Added CodeGenTypes::GetFunctionType, taking a CGFunctionInfo.
- Updated Obj-C runtimes to use this instead of rolling the
llvm::FunctionType by hand.
- Killed CodeGenTypes::{ConvertReturnType, DecodeArgumentTypes}.

Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
- Will move to target sometime soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
2c8e0f32b9c33686be23c70add0b97490903de9f 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
- Will move to target sometime soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
b768807c49a1c7085def099b848631856af766fa 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Tweak CGCall functions again:
- Realized these functions will eventually need access to more data,
moved to CodeGenModule. Eventually they should probably live
together in some other helper class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
5323a4b0a1c248fa2ffdf886bb41a5d8fba71d2d 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Tweak CGCall functions:
- Move actual param attr list creation to
CodeGenFunction::ConstructParamAttrList.
- Make ReturnTypeUsesSret static.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
3913f184c84135fb4612743f1faa6c1edd2dd055 10-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add CodeGenFunction::ReturnTypeUsesSret
- Hook so NeXT runtime doesn't depend on ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.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/CGCall.cpp
46f45b9bec4a265ad8400a538e5ec3a5683617f1 09-Sep-2008 Daniel Dunbar <daniel@zuster.org> Change CodeGen to emit calls using (RValue,Type) list:
- Add CodeGenFunction::EmitAnyExprToTemp
o Like EmitAnyExpr, but emits aggregates to a temporary location if
none is available. Seems like this should be simpler (even aside
from using first class aggregates).

- Killed CodeGenFunction::EmitCallArg (just append the pair)

- Conversion of RValues to actual call arguments is now isolated in
CodeGenFunction::EmitCall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCall.cpp
0dbe227feccf6a8dbadfff8ca3f80416b7bf2f28 08-Sep-2008 Daniel Dunbar <daniel@zuster.org> Refactor parameter attribute handling:
- Add CGCall.h for dealing with ABI issues related to calls.
- Add CGFunctionInfo and CGCallInfo for capturing ABI relevant
information about functions and calls.
- Isolate LLVM parameter attribute handling inside CGCall.cpp


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