History log of /external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

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

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/CodeGen/CodeGenModule.cpp
82e23c2d8aaecc50793e48505e7bb8e820801b35 09-Dec-2013 Manman Ren <manman.ren@gmail.com> Merging r196145:
------------------------------------------------------------------------
r196145 | mren | 2013-12-02 12:10:37 -0800 (Mon, 02 Dec 2013) | 5 lines

Debug Info: Move the constant for Debug Info Version from Dwarf.h to Metadata.h.

Suggested by Eric.
Paired commit with r196144.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f8609ea852fc14933a332573f1d50303081af017 09-Dec-2013 Manman Ren <manman.ren@gmail.com> Merging r196143:
------------------------------------------------------------------------
r196143 | mren | 2013-12-02 11:37:35 -0800 (Mon, 02 Dec 2013) | 1 line

Expand comments for Debug Info Version.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1f856a010fcaf573aa10e1791244a4cbd338d729 09-Dec-2013 Manman Ren <manman.ren@gmail.com> Merging r195495:
------------------------------------------------------------------------
r195495 | mren | 2013-11-22 11:42:45 -0800 (Fri, 22 Nov 2013) | 5 lines

Debug Info: add a "Debug Info Version" module flag to output the current debug
info version number.

Will error out when modules have different version numbers.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a36ef5bd79b056bff82ff30449522b9e39a4363b 25-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195556:
------------------------------------------------------------------------
r195556 | akirtzidis | 2013-11-23 10:41:35 -0800 (Sat, 23 Nov 2013) | 3 lines

[CodeGen] If there is a function definition with duplicate mangled name, emit an error instead of asserting.

rdar://15522601 & http://llvm.org/PR18031
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0cbb3ed856d7b9059c6b52cdeb38db2a5d1a3a66 21-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195283:
------------------------------------------------------------------------
r195283 | hans | 2013-11-20 16:15:56 -0800 (Wed, 20 Nov 2013) | 10 lines

[-cxx-abi microsoft] Emit linkonce_odr definitions for declarations of static data members with inline initializers (PR17689)

This makes Clang emit a linkonce_odr definition for 'val' in the code below,
to be compatible with MSVC-compiled code:

struct Foo {
static const int val = 1;
};

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
54307dac5910aa02358f217773786d61fd83989d 15-Nov-2013 Matt Arsenault <Matthew.Arsenault@amd.com> Fix test failures after addrspacecast added.

Bitcasts between address spaces are no longer allowed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
758c4d86bb9b2298374fce5b3ca4a35f953f2d2e 14-Nov-2013 Joey Gouly <joey.gouly@arm.com> [OpenCL] Make sure we put string literals in the constant address space.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
081c215cca971b6b6d7988e9f48e4793ceb374dc 12-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Keep the old function order in CodeGenModule::applyReplacements.

The original decls are created when used. The replacements are created at the
end of the TU in reverse order.

This makes the original order far better for testing. This is particularly
important since the replacement logic could be used even when
-mconstructor-aliases is not used, but that would make many tests hard to read.

This is a fixed version of r194357 which handles replacing a destructor with
another which is an alias to a third one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e7baa02fc3dd3ce0cc0ba0a321367badb36c5e8c 11-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert "Keep the old function order in CodeGenModule::applyReplacements."

This reverts commit r194357.

Debugging a cast failure during bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194358 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
90f535f3f6d57403ce3d9177745900b2d015dcee 10-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Keep the old function order in CodeGenModule::applyReplacements.

The original decls are created when used. The replacements are created at the
end of the TU in reverse order.

This makes the original order far better for testing. This is particularly
important since the replacement logic could be used even when
-mconstructor-aliases is not used, but that would make many tests hard to read.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
471b52aaab1d175ddad7c24d825dbf0582a1767e 10-Nov-2013 Benjamin Kramer <benny.kra@googlemail.com> Avoid double StringMap lookups. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
61a0a7519ee0d26334d30a001501b8c443d36975 05-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Produce direct calls instead of alias to linkonce_odr functions.

This is a small optimization on linux, but should help more on windows
where msvc only outputs one destructor if there would be two identical ones.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3cebc73895daccea85984d8881b5b45c8f8df9c6 05-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y sized deallocation: if we have a use, but not a definition, of a sized
deallocation function (and the corresponding unsized deallocation function has
been declared), emit a weak discardable definition of the function that
forwards to the corresponding unsized deallocation.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d205498c83c1bba1004ae41299ad7138881b9480 22-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> New fix for pr17535.

This is a fixed version of r193161. In order to handle

void foo() __attribute__((alias("bar")));
void bar() {}
void zed() __attribute__((alias("foo")));

it is not enough to delay aliases to the end of the TU, we have to do two
passes over them to find if they are defined or not.

This can be implemented by producing alias as we go and just doing the second
pass at the end. This has the advantage that other parts of clang that were
expecting alias to be processed in order don't have to be changed.

This patch also handles cyclic aliases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
87017a781f9e2d70a0478abaae26ba486f6e717e 22-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert "This patch causes clang to reject alias attributes that point to undefined names. For example, with this patch we now reject"

This reverts commit r193161.

It broke

void foo() __attribute__((alias("bar")));
void bar() {}
void zed() __attribute__((alias("foo")));

Looks like we have to fix pr17639 first :-(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e37bf44c8012f36f900955d8513e03791803045e 22-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> This patch causes clang to reject alias attributes that point to undefined
names. For example, with this patch we now reject

void f1(void) __attribute__((alias("g1")));

This patch is implemented in CodeGen. It is quiet a bit simpler and more
compatible with gcc than implementing it in Sema. The downside is that the
errors only fire during -emit-llvm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bc6509175e1ce5cc1b48d1b97ac8d23d8b74167c 17-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Rename some functions for consistency.

Every other function in Redeclarable.h was using Decl instead of Declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9686f1234e1b9a44270452477e6690ccadcd204a 16-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Emit a .ident saying that clang produced this file.

Patch by Katya Romanova.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
feba9f2bdc5711894e452dfc67c9679482fbf897 08-Oct-2013 Manman Ren <manman.ren@gmail.com> TBAA: use the same format for scalar TBAA and struct-path aware TBAA.

An updated version of r191586 with bug fix.

Struct-path aware TBAA generates tags to specify the access path,
while scalar TBAA only generates tags to scalar types.

We should not generate a TBAA tag with null being the first field. When
a TBAA type node is null, the tag should be null too. Make sure we
don't decorate an instruction with a null TBAA tag.

Added a testing case for the bug reported by Richard with -relaxed-aliasing
and -fsanitizer=thread.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1596e5b368ddbdc4b9c3ecab75115b179b6e5391 01-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Revert r191586 and r191695. They cause crashes when building with
-relaxed-aliasing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8a06d8fdefce6b4ed4438bb80f60cdd2e979a94f 28-Sep-2013 Manman Ren <manman.ren@gmail.com> TBAA: use the same format for scalar TBAA and struct-path aware TBAA.

Struct-path aware TBAA generates tags to specify the access path,
while scalar TBAA only generates tags to scalar types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0d520f7d2efb471e568b3449f614ea90b48ad1db 04-Sep-2013 David Blaikie <dblaikie@gmail.com> Do not emit duplicate global initializers for template static data members inside namespaces

A quirk of AST representation leads to class template static data member
definitions being visited twice during Clang IRGen resulting in
duplicate (benign) initializers.

Discovered while investigating a possibly-related debug info bug tickled
by the duplicate emission of these members & their associated debug
info.

With thanks to Richard Smith for help investigating, understanding, and
helping with the fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dc1ac5ecf0375e002de1b1be01ccc669e7576b25 03-Sep-2013 Reid Kleckner <reid@kleckner.net> Emit uuid globals as linkonce_odr

Patch by Nico Rieck!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
344472ebeded2fca2ed5013b9e87f81d09bfa908 23-Aug-2013 Robert Wilhelm <robert.wilhelm@gmx.net> Use pop_back_val() instead of both back() and pop_back().
No functionality change intended.


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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8effeda3d2cfd92abaebc5ac46fc3693c69f66f3 15-Aug-2013 David Majnemer <david.majnemer@gmail.com> CodeGen: __uuidof should work even with an incomplete _GUID type

Summary:
We would crash in CodeGen::CodeGenModule::EmitUuidofInitializer
because our attempt to enter CodeGen::CodeGenModule::EmitConstantValue
will be foiled: the type of the constant value is incomplete.

Instead, create an unnamed type with the proper layout on all platforms.
Punt the problem of wrongly defined struct _GUID types to the user.
(It's impossible because the TU may never get to see the type and thus
we can't verify that it is suitable.)

This fixes PR16856.

Reviewers: rsmith, rnk, thakis

Reviewed By: rnk

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c80eb46a0f37bee9597f1b466013a0f6271f9318 13-Aug-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle __uuidof correctly into template parameters

Summary:
It seems that __uuidof introduces a global extern "C" declaration of
type __s_GUID. However, our implementation of __uuidof does not provide
such a declaration and thus must open-code the mangling for __uuidof in
template parameters.

This allows us to codegen scoped COM pointers and other such things.

This fixes PR16836.
Depends on D1356.

Reviewers: rnk, cdavis5x, rsmith

Reviewed By: rnk

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6a4c5dc29eb95561e34333ed1fbe826347a464ba 12-Aug-2013 Alexey Samsonov <samsonov@google.com> Use new llvm::SpecialCaseList API in CodeGenModule

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c8fe011b7e00a20018c8627e0dddd26882ca4499 09-Aug-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section

Revert r188055 which reverted r188053. An unrelated change previously snuck in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
17ffbd03695a590d1c513010b7d4e96b9d5fe7d9 09-Aug-2013 David Majnemer <david.majnemer@gmail.com> Revert "[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section"

This commit reverts r188053.

It is breaking the build bots.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ea3db97495b4a657bff505cd06b71e53ced46805 09-Aug-2013 David Majnemer <david.majnemer@gmail.com> [-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section

We mangled them like:
L___uuid_12345678-1234-1234-1234-123456789abc

We should've mangled them like:
__GUID_12345678_1234_1234_1234_123456789abc

Furthermore, they are external symbols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ef4579cda09b73e3d4d98af48201da25adc29326 06-Aug-2013 Larisse Voufo <lvoufo@google.com> Started implementing variable templates. Top level declarations should be fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bb1b797d2e432293563747bd9704b22cf0787061 04-Aug-2013 Timur Iskhodzhanov <timurrrr@google.com> Emit the constructor for abstract classes when using -cxx-abi microsoft, fixes PR16735

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a4130baad9d10b7feabb7e003da53424e986d269 22-Jul-2013 Reid Kleckner <reid@kleckner.net> [ms-cxxabi] Emit linkonce complete dtors in TUs that need them

Based on Peter Collingbourne's destructor patches.

Prior to this change, clang was considering ?1 to be the complete
destructor and the base destructor, which was wrong. This lead to
crashes when clang tried to emit two LLVM functions with the same name.

In this ABI, TUs with non-inline dtors might not emit a complete
destructor. They are emitted as inline thunks in TUs that need them,
and they always delegate to the base dtors of the complete class and its
virtual bases. This change uses the DeferredDecls machinery to emit
complete dtors as needed.

Currently in clang try body destructors can catch exceptions thrown by
virtual base destructors. In the Microsoft C++ ABI, clang may not have
the destructor definition, in which case clang won't wrap the virtual
virtual base destructor calls in a try-catch. Diagnosing this in user
code is TODO.

Finally, for classes that don't use virtual inheritance, MSVC always
calls the base destructor (?1) directly. This is a useful code size
optimization that avoids emitting lots of extra thunks or aliases.
Implementing it also means our existing tests continue to pass, and is
consistent with MSVC's output.

We can do the same for Itanium by tweaking GetAddrOfCXXDestructor, but
it will require further testing.

Reviewers: rjmccall

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
73701ea646d067e5d26e83a95ae0e610f0e665ca 22-Jul-2013 Reid Kleckner <reid@kleckner.net> Rename D to GD to match the type, which is GlobalDecl

Now we can save GD.getDecl() in D and shorten some casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ddcff1b310b80b63f1a9ba88f2befeab40c3648f 22-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Tighten up the set of operator new/operator delete calls we're permitted to
optimize, to follow the permissions granted in N3664. Under those rules, only
calls generated by new-expressions and delete-expressions are permitted to be
optimized, and direct calls to ::operator new and ::operator delete must be
treated as normal calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e5798893b1fb2468a11e8374d340e6fa2f82a9a5 10-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Get rid of dead/useless code for block mangling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7a36a5913f045bfaf6d26ed874e39a3e7c1ad9ae 01-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Simplify linkage code for static local vars.

The key insight here is that weak linkage for a static local variable
should always mean linkonce_odr, because every file that needs it will
generate a definition. We don't actually care about the precise linkage
of the parent context. I feel a bit silly that I didn't realize this before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
07369dde9d72213bf8a48288cd8b29999af9a40c 01-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix mangling for block literals.

Blocks, like lambdas, can be written in contexts which are required to be
treated as the same under ODR. Unlike lambdas, it isn't possible to actually
take the address of a block, so the mangling of the block itself doesn't
matter. However, objects like static variables inside a block do need to
be mangled in a consistent way.

There are basically three components here. One, block literals need a
consistent numbering. Two, objects/types inside a block literal need
to be mangled using it. Three, objects/types inside a block literal need
to have their linkage computed correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.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/CodeGenModule.cpp
1fea06d6116249aadcd8d02127e506dd85d4e659 19-Jun-2013 NAKAMURA Takumi <geek4civic@gmail.com> Fix a warning. [-Wunused-variable]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
fc0f91cf0673775ce4b8b174dbb05ad2e4e6cd01 19-Jun-2013 Manman Ren <mren@apple.com> Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4

These options will add a module flag with name "Dwarf Version".
The behavior flag is currently set to Warning, so when two values disagree,
a warning will be emitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
3282b84296dba58e811741b63e4429980a98df8b 14-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Emit initializers for static-storage-duration temporaries as constants where
possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
678eca456bc62900dc7407bdbc9fa282da9d2f8f 13-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Fix the linkage of static locals inside a CapturedStmt. (Found in the
process of trying to fix the related issue for block literals.)



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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
144a31f53b0a97a2c46bfcb1e2a40fa8327b8e89 05-Jun-2013 Peter Collingbourne <peter@pcc.me.uk> [ms-cxxabi] Thread GlobalDecls through to CodeGenModule::getFunctionLinkage.

This is so that we can give destructor variants different linkage later.

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a7ff62f9443efa3b13a28a1e566d4625b15b8553 04-Jun-2013 Aaron Ballman <aaron@aaronballman.com> Adding support for MSVC #pragma detect_mismatch functionality by emitting a FAILIFMISMATCH linker command into the object file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d27e5cbff3c98fa3f623c75dce7165176c1f98a5 24-May-2013 Diego Novillo <dnovillo@google.com> [PATCH] Generate cold attribute for functions marked __atribute__((cold))

This removes a FIXME in CodeGenModule::SetLLVMFunctionAttributesForDefinition.
When a function is declared cold we can now generate the IR attribute in
addition to marking the function to be optimized for size.

I tried adding a separate CHECK in the existing test, but it was
failing. I suppose CHECK matches one line exactly once? This would be
a problem if the attributes are listed in a different order, though they
seem to be sorted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
fc46ebc2b1345723a894ae352cfb206c1d930295 21-May-2013 David Blaikie <dblaikie@gmail.com> PR14606: Debug Info for namespace aliases/DW_TAG_imported_module

This resolves the last of the PR14606 failures in the GDB 7.5 test
suite. (but there are still unresolved issues in the imported_decl case
- we need to implement optional/lazy decls for functions & variables
like we already do for types)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a722534711fd93b5685e1a00f37a62f6a578dacd 20-May-2013 Reid Kleckner <reid@kleckner.net> Implement __declspec(selectany) under -fms-extensions

selectany only applies to externally visible global variables. It has
the effect of making the data weak_odr.

The MSDN docs suggest that unused definitions can only be dropped at
linktime, so Clang uses weak instead of linkonce. MSVC optimizes away
references to constant selectany data, so it must assume that there is
only one definition, hence weak_odr.

Reviewers: espindola

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
181e3ecc0907ae0103586a9f4db52241995a8267 13-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Cleanup handling of UniqueExternalLinkage.

This patch renames getLinkage to getLinkageInternal. Only code that
needs to handle UniqueExternalLinkage specially should call this.

Linkage, as defined in the c++ standard, is provided by
getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage.

Most places in the compiler actually want isExternallyVisible, which
handles UniqueExternalLinkage as internal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
06a9d0431fefb41d46e43dfac4770c5bb6156b02 11-May-2013 Benjamin Kramer <benny.kra@googlemail.com> CodeGen: Refactor SetLLVMFunctionAttributesForDefinition to use an AttrBuilder.

Adding attributes to a uniqued set has become expensive, don't do it more often
than necessary. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0a050f7d56039bab7556e08b359e06d329977b6b 10-May-2013 Adrian Prantl <aprantl@apple.com> Debug Info: Fix a problem that resulted in missing DW_AT_specifications
for C++ constructors.

If the DIType for a class was generated by
CGDebugInfo::createContextChain(), the cache contains only a
limited DIType wihtout any declarations. Since EmitFunctionStart()
needs to find the canonical declaration for each method, we
construct the complete type before emitting any method.

rdar://problem/13116508

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3190ca922d3743137e15fe0c525c04b177b9983b 08-May-2013 Reid Kleckner <reid@kleckner.net> Forward #pragma comment(lib/linker) through as flags metadata

Summary:
Most of this change is wiring the pragma all the way through from the
lexer, parser, and sema to codegen. I considered adding a Decl AST node
for this, but it seemed too heavyweight.

Mach-O already uses a metadata flag called "Linker Options" to do this
kind of auto-linking. This change follows that pattern.

LLVM knows how to forward the "Linker Options" metadata into the COFF
.drectve section where these flags belong. ELF support is not
implemented, but possible.

This is related to auto-linking, which is http://llvm.org/PR13016.

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6b20351a1d6178addfaa86716aaba36f2e9ea188 06-May-2013 Ulrich Weigand <ulrich.weigand@de.ibm.com> Allow targets to define minimum alignment for global variables

This patch adds a new common code feature that allows platform code to
request minimum alignment of global symbols. The background for this is
that on SystemZ, the most efficient way to load addresses of global symbol
is the LOAD ADDRESS RELATIVE LONG (LARL) instruction. This instruction
provides PC-relative addressing, but only to *even* addresses. For this
reason, existing compilers will guarantee that global symbols are always
aligned to at least 2. [ Since symbols would otherwise already use a
default alignment based on their type, this will usually only affect global
objects of character type or character arrays. ] GCC also allows creating
symbols without that extra alignment by using explicit "aligned" attributes
(which then need to be used on both definition and each use of the symbol).

To enable support for this with Clang, this patch adds a
TargetInfo::MinGlobalAlign variable that provides a global minimum for the
alignment of every global object (unless overridden via explicit alignment
attribute), and adds code to respect this setting. Within this patch, no
platform actually sets the value to anything but the default 1, resulting
in no change in behaviour on any existing target.

This version of the patch incorporates feedback from reviews by
Eric Christopher and John McCall. Thanks to all reviewers!

Patch by Richard Sandiford.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d8ffd0b7b61566f15a67192883a607f7703bcece 05-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Make all 'is in extern "C"' tests use the lexical context.

I was not able to find a case (other than the fix in r181163) where this
makes a difference, but it is a more obviously correct API to have.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dc17384581e37436582a007be4d9185bcf7003ec 04-May-2013 Enea Zaffanella <zaffanella@cs.unipr.it> In VarDecl nodes, store the thread storage class specifier as written.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4e3b54b4acb4dd926ca50d7f06c8265d1d24ba79 02-May-2013 Bill Wendling <isanbard@gmail.com> Use the Itanium ABI for thread_local on Darwin.

After some discussion, it was decided to use the Itanium ABI for thread_local on
Darwin OS X platforms. This involved a couple of changes. First, we use
"_tlv_atexit" instead of "__cxa_thread_atexit". Secondly, the global variables
are marked with 'internal' linkage, because we want all access to be calls to
the Itanium-specific entry point, which has normal linkage.
<rdar://problem/13733006>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8f4bdc0e37b4b24a58a15ecf41d1355a3b3fdcbb 30-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Revert r180739 and r180748: they broke C++11 thread_local on non-Darwin systems and did not do the right thing on Darwin.

Original commit message:

Emit the TLS intialization functions into a list.

Add the TLS initialization functions to a list of initialization functions. The
back-end takes this list and places the function pointers into the correct
section. This way they're called before `main().'

<rdar://problem/13733006>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7c6b7ba5f5410d4b552ee53c60d0690522c99959 30-Apr-2013 Bill Wendling <isanbard@gmail.com> Emit the TLS intialization functions into a list.

Add the TLS initialization functions to a list of initialization functions. The
back-end takes this list and places the function pointers into the correct
section. This way they're called before `main().'

<rdar://problem/13733006>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1601a4a5da8b895fa598efc9e0e736aae5bf00c5 26-Apr-2013 David Blaikie <dblaikie@gmail.com> Support debug info for using directives at global/namespace scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
db4f61f9fb0edc16b5568af0bf6a6729718b349f 22-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't emit _ZTW wrappers for TLS variables which don't use the C++ thread_local keyword.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3abae0995b5d4faa3d8cfb1f06118d71a60c7dab 17-Apr-2013 John McCall <rjmccall@apple.com> Don't propagate around TargetOptions in IR-gen; we don't use it.

Patch by Stephen Lin!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
f4910132078b4b8852fc46657f3150ed472f4654 16-Apr-2013 Daniel Dunbar <daniel@zuster.org> [Modules] Convert module specific -fno-modules-autolink into -fno-autolink.

- There is no reason to have a modules specific flag for disabling
autolinking. Instead, convert the existing flag into -fno-autolink (which
should cover other autolinking code generation paths like #pragmas if and
when we support them).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
428edb7f7599b4ee44eaad00bb3c330495fc1ad6 16-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C IRGen. Use llvm::WeakVH
for caching couple of global symbols used
for generation of CF/NS string meta-data
so they are not released prematuely in certain
corner cases. // rdar:// 13598026.
Reviewed by John M.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
04e517650569598e847c2ab609672e6df93effe5 15-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> CodeGen support for function-local static thread_local variables with
non-constant constructors or non-trivial destructors. Plus bugfixes for
thread_local references bound to temporaries (the temporaries themselves are
lifetime-extended to become thread_local), and the corresponding case for
std::initializer_list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
38afbc7361d861968232defaeaf8e302af75b5ee 13-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Annotate flavor of TLS variable (statically or dynamically initialized) onto the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
84083b74abc4a2d1a9013ce4c75d63ee7d6d1da3 13-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Use MapVector rather than simulating it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ca835180412eb4382fe4cc97e9374489b9ad3946 12-Apr-2013 Manman Ren <mren@apple.com> Struct-path aware TBAA: uniformize scalar tag and path tag.

For struct-path aware TBAA, we used to use scalar type node as the scalar tag,
which has an incompatible format with the struct path tag. We now use the same
format: base type, access type and offset.

We also uniformize the scalar type node and the struct type node: name, a list
of pairs (offset + pointer to MDNode). For scalar type, we have a single pair.
These are to make implementaiton of aliasing rules easier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6797204b89c0edb9496249fba557b45d8cc9ec76 06-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Remove nondeterminism introduced in r178950.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0024937dbb23752f606846f4a12aafc712bcde33 06-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> When an internal-linkage function or variable is declared within an extern "C"
linkage specification, and is marked as __attribute__((used)), try to also give
it the unmangled name (by emitting an internal linkage alias) if nothing else
within the translation unit would use that name. This allows inline asm in that
translation unit to use the entity via its unmangled name, which people
apparently rely on.


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

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


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

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

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

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

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

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

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

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

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

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

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

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

Expr *BaseIvarExp;

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

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

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

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

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

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

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

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

bool isTypeConstant(QualType QTy, bool ExcludeCtorDtor);

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

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

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

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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d2615cc53b916e8aae45783ca7113b93de515ce3 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add 178663 back.

http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green
before it processed the reverted 178663, so it could not have been the culprit.

Revert "Revert 178663."

This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert 178663.

Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb

Revert "Don't compute a patched/semantic storage class."

This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8f187f62cb0487d31bc4afdfcd47e11fe9a51d05 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't compute a patched/semantic storage class.

For variables and functions clang used to store two storage classes. The one
"as written" in the code and a patched one, which, for example, propagates
static to the following decls.

This apparently is from the days clang lacked linkage computation. It is now
redundant and this patch removes it.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9a2f5d70dfb0eb739076d5bad1a779de9b201930 19-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't try to set attributes in alias, they have none.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7e73f94c104070cf03c6f711a10f1928a550193f 06-Mar-2013 Alexey Samsonov <samsonov@google.com> [Sanitize] Don't emit function attribute sanitize_address/thread/memory if the function is blacklisted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
f127eb8aeb3ce861f3dbc1adbb3362bfd98461e1 27-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Rename methods to comply with the LLVM Coding Standards.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2beda12c3fbaa9125831b7f818680978c596b205 27-Feb-2013 Rafael Espindola <rafael.espindola@gmail.com> Move LinkageInfo out of NamedDecl so that it can be used in Type.h.

Everything that cares about visibility also cares about linkage, so I just
moved it to Visibility.h instead of creating a new .h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
85aee96c62a99069ea60cb47d5ae69150ca44746 26-Feb-2013 Kostya Serebryany <kcc@google.com> Unify clang/llvm attributes for asan/tsan/msan (Clang part)

These are two related changes (one in llvm, one in clang).
LLVM:
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG:
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
afda905e60151f0bc34c187d51a798b4265f69af 24-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> In Sema::InstantiateStaticDataMemberDefinition, pass the var decl to the consumer
just using ASTConsumer::HandleCXXStaticMemberVarInstantiation(), don't pass it with
ASTConsumer::HandleTopLevelDecl.

ASTConsumer::HandleTopLevelDecl is intended for user-written top-level decls;
a consumer can treat an instantiated static data member however it wants of course.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
684aa73192d92850a926870be62a1787eb5b7ed9 22-Feb-2013 Michael Han <fragmentshaders@gmail.com> [Sema] Semantic analysis for empty-declaration and attribute-declaration.

Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain
to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these
attributes can be sema checked just as attributes attached to "normal" declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
d4c3d66be70ae2d0bd828329022dc428cc277a1c 20-Feb-2013 John McCall <rjmccall@apple.com> Add a new 'type_visibility' attribute to allow users to
control the visibility of a type for the purposes of RTTI
and template argument restrictions independently of how
visibility propagates to its non-type member declarations.

Also fix r175326 to not ignore template argument visibility
on a template explicit instantiation when a member has
an explicit attribute but the instantiation does not.

The type_visibility work is rdar://11880378

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175587 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
3f6f51e28231f65de9c2dd150a2d757b2162cfa3 08-Feb-2013 Jordan Rose <jordan_rose@apple.com> Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.

Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c264e16a42b3f6c36521857a29ea0949d9781c22 31-Jan-2013 Tim Northover <Tim.Northover@arm.com> Add support for AArch64 target.

In cooperation with the LLVM patch, this should implement all scalar front-end
parts of the C and C++ ABIs for AArch64.

This patch excludes the NEON support also reviewed due to an outbreak of
batshit insanity in our legal department. That will be committed soon bringing
the changes to precisely what has been approved.

Further reviews would be gratefully received.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c4c62fd78a4728c9e4d4df14911a2ced9bdd2031 31-Jan-2013 Bill Wendling <isanbard@gmail.com> Make sure that the Attribute object represents one attribute only.

Several places were still treating the Attribute object as respresenting
multiple attributes. Those places now use the AttributeSet to represent
multiple attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
cb5620c9b213f4bd323912159fdddda35e258a14 30-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Move UTF conversion routines from clang/lib/Basic to llvm/lib/Support

This is required to use them in TableGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
96fcde0b8ed8bdf99d326312ca7be6447b0fe5fc 26-Jan-2013 John McCall <rjmccall@apple.com> Move the decision about the kind of CGCXXABI to make inside
the family-specific files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d5617eeafc93209a26b9f88276c88cf997c3a0a7 25-Jan-2013 John McCall <rjmccall@apple.com> The standard ARM C++ ABI dictates that inline functions are
never key functions. We did not implement that rule for the
iOS ABI, which was driven by what was implemented in gcc-4.2.
However, implement it now for other ARM-based platforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b8b2c9da87e7d70a1679db026f40548b3192b705 25-Jan-2013 John McCall <rjmccall@apple.com> First pass at abstracting out a class for the target C++ ABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
909b6ded6be68a5740d98b478454fa55ea817ad6 23-Jan-2013 Bill Wendling <isanbard@gmail.com> Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ed01f84d20a1586b2d639b47463cf1f22418f0f6 21-Jan-2013 Bill Wendling <isanbard@gmail.com> Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.

This further restricts the use of the Attribute class to the Attribute family of
classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a37ce617af7300eee3ceab435021c342e62c5661 21-Jan-2013 Bill Wendling <isanbard@gmail.com> Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.

This is more code to isolate the use of the Attribute class to that of just
holding one attribute instead of a collection of attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e67e4c93dfc9d68bff094c61b588f87456917f6f 18-Jan-2013 Bill Wendling <isanbard@gmail.com> Use the AttributeSet query method instead of the Attribute method.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f9d03c15e8642d4bd3686b8c8e8269242a0f37c6 17-Jan-2013 Daniel Dunbar <daniel@zuster.org> [IRgen] Update modules autolink metadata to use module flags (as now specified
in the LangRef).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f43b7214e812ddca74a6213608c69c960e067956 16-Jan-2013 Douglas Gregor <dgregor@apple.com> Add -fmodules-autolink/-fno-modules-autolink (defaults to on) so that
users can explicitly enable/disable modules autolinking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5ba58a1b3cbe79497380e7ccecbe45c8bdd498c1 15-Jan-2013 David Greene <greened@obbligato.org> Fix Const Cast

Do proper casting to avoid a cast-away-const error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
858afb3c22144027bcd8ba75e27262eede093a60 14-Jan-2013 Douglas Gregor <dgregor@apple.com> Topologically sort the link options generated for modules based on
module-import dependencies, so we'll get the link order correct for
those silly linkers that need it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3baad29d4413e1409fc69a472d374cf5de1d78ec 14-Jan-2013 Douglas Gregor <dgregor@apple.com> When forming the link options for an imported module, also include the
link options for the modules it imports.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5d75ea72d6eee3df0c6acdb282145dc4cc3a9a1b 14-Jan-2013 Douglas Gregor <dgregor@apple.com> Switch autolinking metadata format over to actual linker options, e.g.,

!0 = metadata !{metadata !"-lautolink"}
!1 = metadata !{metadata !"-framework", metadata !"autolink_framework"}

referenced from llvm.module.linkoptions, e.g.,

!llvm.module.linkoptions = !{!0, !1, !2, !3}

This conceptually moves the logic for figuring out the syntax the
linker will accept from LLVM into Clang. Moreover, it makes it easier
to support MSVC's

#pragma comment(linker, "some option")

in the future, should anyone care to do so.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b6cbe517237c3c223beb064d60d5b49e56d65c06 14-Jan-2013 Douglas Gregor <dgregor@apple.com> Implement parsing, AST, (de-)serialization, and placeholder global
metadata for linking against the libraries/frameworks for imported
modules.

The module map language is extended with a new "link" directive that
specifies what library or framework to link against when a module is
imported, e.g.,

link "clangAST"

or

link framework "MyFramework"

Importing the corresponding module (or any of its submodules) will
eventually link against the named library/framework.

For now, I've added some placeholder global metadata that encodes the
imported libraries/frameworks, so that we can test that this
information gets through to the IR. The format of the data is still
under discussion.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.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/CodeGenModule.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/CodeGenModule.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/CodeGenModule.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/CodeGenModule.cpp
a923c9783e8bd8edd26e56df9eaacd872c43e20e 12-Dec-2012 John McCall <rjmccall@apple.com> Rewrite calls to bitcast unprototyped functions when emitting a definition.

My variadics patch, r169588, changed these calls to typically be
bitcasts rather than calls to a supposedly variadic function.
This totally subverted a hack where we intentionally dropped
excess arguments from such calls in order to appease the inliner
and a "warning" from the optimizer. This patch extends the hack
to also work with bitcasts, as well as teaching it to rewrite
invokes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.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/CodeGenModule.cpp
96a66392649f23e19bb9b2d512f2779b9dd420d0 03-Dec-2012 Alexey Samsonov <samsonov@google.com> Fix PR14474: don't emit debug info for interface types in -gline-tables-only mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
ca1b62a33cacee20d3bd756210d3211dd663209e 05-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167405 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
aee56faf90c04a75d9c432a92a8fdd2c875559a7 02-Nov-2012 Quentin Colombet <qcolombet@apple.com> Update the front end to use minsize attribute

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8e68ef0e4c3892b80d9fec77b5d477cd54e90db9 29-Oct-2012 Quentin Colombet <qcolombet@apple.com> Revert commit r166946

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ba927d9b26ead2ad535c7761b8862d8e82c41b13 29-Oct-2012 Quentin Colombet <qcolombet@apple.com> Make forcesizeopt attribute available to the end user

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
107dae4c7afca73e97d2689d6f644c13ac3048a4 27-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> Add comment for my patch in r166809.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c1868e533e63a1b7dad7a22714fc593c045382ae 26-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C IRGen: for @implementation nested in
extern "C", its method definitions must be IRGen'ed
before meta-data for class is generated. Otherwise,
IRGen crashes (to say the least).
// rdar://12581683


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
aafd111afa6acd50fe4bec6c41add02ecf556535 24-Oct-2012 Douglas Gregor <dgregor@apple.com> Remove the HiddenWeakTemplateVTables CodeGen option. It's currently unused.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b03527a9a395168762ad8e25e59a7a272dd74561 17-Oct-2012 John McCall <rjmccall@apple.com> Set a special flag in class metadata when an Objective-C class
has ivars that require destruction, but none that require anything
except zero-initialization. This is common in ARC and (when true
throughout a class hierarchy) permits the elimination of an
unnecessary message-send during allocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
193646f16d90f004123965606ec3fae180beafe1 17-Oct-2012 Nico Weber <nicolasweber@gmx.de> "'Might as well make it static const.' -- John McCall" -- Michael Scott



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4695f91f4302a90ae462cd64dda59b34c3dad821 16-Oct-2012 Joerg Sonnenberger <joerg@bec.de> When using a symbol with attribute weakref, search for it first and
don't try the normal GetOrCreateLLVM. The latter could drop the weak
atrtibute on the second reference, if there is no explicit declaration
of the aliasee.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.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/CodeGenModule.cpp
4d68ed5f03ad1235946377eb32b5c4d0412f2e48 14-Oct-2012 Bill Wendling <isanbard@gmail.com> Remove operator cast method in favor of querying with the correct method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
43085815b1b377dc30176afab2b96d6b807d42de 13-Oct-2012 Nico Weber <nicolasweber@gmx.de> Simplify. Suggestion by Sean Silva.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1e4691b9d8e1bdcc8ef62b323969d702c51b3c08 10-Oct-2012 Jordan Rose <jordan_rose@apple.com> Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.

This more accurately reflects its use: this flag is set when a method
matches the getter or setter name for a property in the same class,
and does not actually specify whether or not the definition of the method
will be synthesized (either implicitly or explicitly with @synthesize).

This renames the setter and backing field as well, and changes the
(soon-to-be-obsolete?) XML dump format to use 'property_accessor'
instead of 'synthesized'.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5c3e4ca581faa27c74443d17e5f740a686b62884 09-Oct-2012 Bill Wendling <isanbard@gmail.com> We use the enums to query whether an Attributes object has that attribute. The
opaque layer is responsible for knowing where that specific attribute is stored.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
c857ce8b08397ed778928b8a000732ca90da2a8c 06-Oct-2012 Alex Rosenberg <alexr@leftfield.org> Propagate calling convention for aliases and weakrefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165343 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ef4d5ced04bf0b3d987e6b0e931f43125492f50c 29-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13941: Mark all virtual functions as unnamed_addr. It's not possible to
observe their addresses (taking their address gives the vtable slot) so we are
free to merge their definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b22c7dc707cf3770ff3b5e5f11f11fd0aaa06d9b 28-Sep-2012 Dan Gohman <gohman@apple.com> Add basic support for adding !tbaa.struct metadata on llvm.memcpy calls for
struct assignment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bc3a3a7469f6b93df6397dd9789006fec7b0ea44 26-Sep-2012 Bill Wendling <isanbard@gmail.com> Update to new function attribute querying syntax.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
31ba6135375433b617a8587ea6cc836a014ebd86 06-Sep-2012 Roman Divacky <rdivacky@freebsd.org> Dont cast away const needlessly. Found by gcc48 -Wcast-qual.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3b6bef9a213249c6ab6d67c07b1ac6380961be3e 24-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Push ArrayRef through the Expr hierarchy.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d48bcb2f4dedf8e7b654cb017968b3d7b6663a57 22-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Reduce duplicated hash map lookups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
05c5ebc9bafe5613204eefb59a47ab878e4fbd0b 21-Aug-2012 Kostya Serebryany <kcc@google.com> [asan] If we are compiling with ASan, add metadata indicating dynamically initialized globals. Patch by Reid Watson, reviewed by Richard Smith

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8ce9cca118b32604f481ad381eafab25b5798c9f 10-Aug-2012 Joerg Sonnenberger <joerg@bec.de> Decrementing std::string::end is not portable, use array access instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ffb0c3adc27d257c8453886957b8d220d1ad14d8 20-Jul-2012 Eric Christopher <echristo@apple.com> Remove HasSynthBitfield and all callers/writers/etc. Also remove
previous ResetObjCLayout calls since this is now handled in Sema.

Part of rdar://11842763

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160527 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f7226fbe677a9c7578fa0613491ed15c6dc6a5e1 12-Jul-2012 John McCall <rjmccall@apple.com> Add the ObjFW runtime. Patch by Jonathan Schleifer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
11d3f4cc27e6b923fc32481dc1bb5ec46c7d1f4b 03-Jul-2012 David Chisnall <csdavec@swan.ac.uk> Rename the GCC Objective-C runtime to gcc from gnu-fragile and the GNUstep
runtime to gnustep from gnu. Fix EH for the GCC runtime.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b135f0f2d893121ed2cc46d4d6c5bd5ab87d872f 02-Jul-2012 Eli Friedman <eli.friedman@gmail.com> When we're looking for redeclarations which might provide a definition in CodeGen, make sure we examine all the redeclarations. PR13252.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
de981f3ff163bc9ec69e4c5e7316e94276412993 28-Jun-2012 Hans Wennborg <hans@hanshq.net> Add -ftls-model command-line flag.

This allows for setting the default TLS model. (PR9788)

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9ee494f98610dcd79441dce469d7bf609fcd7b92 24-Jun-2012 Charles Davis <cdavis@mines.edu> IRGen: Factor v-table generation into the CGCXXABI object.

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

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

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

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

This depends on LLVM r159077.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
260611a32535c851237926bfcf78869b13c07d5b 20-Jun-2012 John McCall <rjmccall@apple.com> Restructure how the driver communicates information about the
target Objective-C runtime down to the frontend: break this
down into a single target runtime kind and version, and compute
all the relevant information from that. This makes it
relatively painless to add support for new runtimes to the
compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z,
available at the driver level as a better and more general
alternative to -fgnu-runtime and -fnext-runtime. This new
concept of an Objective-C runtime also encompasses what we
were previously separating out as the "Objective-C ABI", so
fragile vs. non-fragile runtimes are now really modelled as
different kinds of runtime, paving the way for better overall
differentiation.

As a sort of special case, continue to accept the -cc1 flag
-fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak.

I won't go so far as to say "no functionality change", even
ignoring the new driver flag, but subtle changes in driver
semantics are almost certainly not intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
adc6cbf5b502f1b58078455ab4fca66c7daac239 18-Jun-2012 Michael J. Spencer <bigcheesegs@gmail.com> [MSExtensions] Add support for __forceinline.

__forceinline is a combination of the inline keyword and __attribute__((always_inline))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ca5233044ef679840d1ad1c46a36b16e2ee8a6e1 10-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13064: Store whether an in-class initializer uses direct or copy
initialization, and use that information to produce the right kind of
initialization during template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.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/CodeGenModule.cpp
4dc34ebf2a0716bf77ba110dab6777a3fc4397dd 20-May-2012 Peter Collingbourne <peter@pcc.me.uk> CUDA: add CodeGen support for global variable address spaces.
Because in CUDA types do not have associated address spaces,
globals are declared in their "native" address space, and accessed
by bitcasting the pointer to address space 0. This relies on address
space 0 being a unified address space.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ee409a916e9b97ed6bc2f48d8d6aac6b8b773d7b 12-May-2012 Benjamin Kramer <benny.kra@googlemail.com> Add support for __attribute__((hot)) and __attribute__((cold)).

Currently cold functions are marked with the "optsize" attribute in CodeGen
so they are always optimized for size. The hot attribute is just ignored,
LLVM doesn't have a way to express hotness at the moment.

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

Reviewed by Eric Christopher.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
3a70cd6e1cc414856e41ce5509aa61c89bf472dc 27-Apr-2012 Alexey Samsonov <samsonov@google.com> Use enum to set debug info size generated by Clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155697 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c9fe6056e4ce8ffad1ef439fca3318a5faf1c075 24-Apr-2012 Kostya Serebryany <kcc@google.com> enable TBAA when -fthread-sanitizer is given, even with -O0 or -relaxed-aliasing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0ff258b933fe385425bf2a85429bf46376d338f1 17-Apr-2012 Eric Christopher <echristo@apple.com> Typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
be6c6869a993536d4cd007f04e84ef74a1c3b229 11-Apr-2012 Eric Christopher <echristo@apple.com> Enable debug info for objective c implementations that may not have
an explicit instance variable.

rdar://10590352

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

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
84392d0edc7127f868d3c97484ffc9d789c317ff 30-Mar-2012 Bill Wendling <isanbard@gmail.com> The UTF16 string referenced by a CFString should go into the __TEXT,__ustring
section. A 'normal' string will go into the __TEXT,__const section, but this
isn't good for UTF16 strings. The __ustring section allows for coalescing, among
other niceties (such as allowing the linker to easily split up strings).

Instead of outputting the UTF16 string as a series of bytes, output it as a
series of shorts. The back-end will then nicely place the UTF16 string into the
correct section, because it's a mensch.
<rdar://problem/10655949>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8322c23956c4dea057a930753f23ff6467353e55 30-Mar-2012 Bill Wendling <isanbard@gmail.com> Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8cb4a070d491ddd671b049110cc8d0accb08b905 26-Mar-2012 Kostya Serebryany <kcc@google.com> add tbaa metadata to vtable pointer loads/stores

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7e42392eb2ea29ddeb6d125417fb4c17d847b5e0 24-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Simplify some users of DenseMap::erase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
025039377d7247620750205dbd61ca1ba336f7e0 08-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Replace MarkVarRequired with a more generic
HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
234fe654a3dd2888be42ae5db34db96c5c2c4ba3 05-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix a small difference in sema and codegen views of what needs to be output.

In the included testcase, soma thinks that we already have a definition after we
see the out of line decl. Codegen puts it in a deferred list, to be output if
a use is seen. This would break when we saw an explicit template instantiation
definition, since codegen would not be notified.

This patch adds a method to the consumer interface so that soma can notify
codegen that this decl is now required.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a3ca41f0c2bd1c4a752df88b283332f3b757d21e 03-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Reinstate r151879, r151880, reverted in r151922, along with a bugfix for
scalar emission of DeclRefExprs to const bools: emit scalar bools as i1,
not as i8.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
062a82cdfab01d95f7fa3d759342e6f2ee5c51b0 28-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Hack in a loud error for PR12086. Better than a silent miscompile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
19b1a6eb2c90fab7cefe74bea5b6de490b65ac9d 25-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> CodeGen support for global variables of type std::initializer_list<X>.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
51b2f6bae6847ccf4c48960c925316dccfb10190 18-Feb-2012 Eric Christopher <echristo@apple.com> Remove UpdateCompletedType from the debug info emission. We now
emit less than complete types on purpose on occasion and so
our caches aren't useful for this kind of lazy emitting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a9b21d22bb9337649723a8477b5cb15f83451e7d 17-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Bug fix: do not emit static const local variables with mutable members
as constants.

Refactor and simplify all the separate checks for whether a type can be
emitted as a constant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e15c71236252c21a77c8a406246053e1cbb63ffa 17-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> When performing IRGen on a global, emit it as a constant if:
1) It has a const-qualified type, and
2) It has no mutable members, and
3) It has no dynamic initialization, and
4) It has trivial destruction.
Remove the unnecessary requirement that the type be POD. This allows us to
mark all constexpr objects with no mutable members as 'constant'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.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/CodeGenModule.cpp
7ca4850a3e3530fa6c93b64b740446e32c97f992 13-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Deal with a horrible C++11 special case. If a non-literal type has a constexpr
constructor, and that constructor is used to initialize an object of static
storage duration such that all members and bases are initialized by constant
expressions, constant initialization is performed. In this case, the object
can still have a non-trivial destructor, and if it does, we must emit a dynamic
initializer which performs no initialization and instead simply registers that
destructor.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d79ed43d2bb9dd4a54889450ecff9299a9d4d1bc 06-Feb-2012 Chris Lattner <sabre@nondot.org> build wide strings with ConstantDataArray, just because we can.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
812234b70461eafd43acb6ccbd736bb4bbf88728 06-Feb-2012 Chris Lattner <sabre@nondot.org> improve the code that handles IR generation of byte-sized string literals to avoid
allocating an std::string.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0b2397132efe74ee11c1b371dd9033820c54240f 06-Feb-2012 Chris Lattner <sabre@nondot.org> use cheaper llvm APIs for various bits of IR generation.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f7ccbad5d9949e7ddd1cbef43d482553b811e026 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import SmallString<> into clang namespace

(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
89651eaf4170168cac2f34f2738e3d58fc38bbf1 02-Feb-2012 Alexander Potapenko <glider@google.com> Move the code that sets the AddressSafety
attribute into CodeGenModule::SetLLVMFunctionAttributesForDefinition().

Previously it resided in CodeGenModule::GetOrCreateLLVMFunction, which
for some reason wasn't called for ObjC class methods, see
http://code.google.com/p/address-sanitizer/issues/detail?id=33



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5d3a4bb13dfad72c89df09bce70351175ecd19dc 01-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r149363 which was part a series of commits that were reverted in llvm
commit 149470. This fixes test/CodeGen/PR3589-freestanding-libcalls.c.

Original log:

ConstantArray::get() (for strings) is going away, use
ConstantDataArray::getString instead.

Many instances of ConstantArray::get() could be moved to
use more efficient ConstantDataArray methods that avoid a ton
of intermediate Constant*'s for each element (e.g.
GetConstantArrayFromStringLiteral). I don't plan on doing this
in the short-term though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
29254f4dd114fe2dd5c4e7a261ebea941973ad3d 31-Jan-2012 David Chisnall <csdavec@swan.ac.uk> Support @compatibility_alias at run time (GNUstep Runtime)

Patch by Niels Grewe!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ff8f9ec8336c62b5e3504e2a394f4b25c0cb1963 31-Jan-2012 Chris Lattner <sabre@nondot.org> ConstantArray::get() (for strings) is going away, use
ConstantDataArray::getString instead.

Many instances of ConstantArray::get() could be moved to
use more efficient ConstantDataArray methods that avoid a ton
of intermediate Constant*'s for each element (e.g.
GetConstantArrayFromStringLiteral). I don't plan on doing this
in the short-term though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
71efba0bbafaefab14419fbd284efff5f7acade7 24-Jan-2012 Kostya Serebryany <kcc@google.com> The following patch adds __attribute__((no_address_safety_analysis)) which will allow to disable
address safety analysis (such as e.g. AddressSanitizer or SAFECode) for a specific function.

When building with AddressSanitizer, add AddressSafety function attribute to every generated function
except for those that have __attribute__((no_address_safety_analysis)).

With this patch we will be able to
1. disable AddressSanitizer for a particular function
2. disable AddressSanitizer-hostile optimizations (such as some cases of load widening) when AddressSanitizer is on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3026348bd4c13a0f83b59839f64065e0fcbea253 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7d6a7c004361c45a463874a58da28d9f3c35f2e6 18-Jan-2012 Seth Cantrell <seth.cantrell@gmail.com> test svn commit access

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f6b56374e4e5b9f0078efac5ed4918c3a04296f7 18-Jan-2012 Nick Lewycky <nicholas@mxc.ca> Fix a string over-run detected by ASAN.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
22afaccd9ab77d46106e94c47907d955a014ae3f 18-Jan-2012 Nick Lewycky <nicholas@mxc.ca> Fix special king of typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ef96ee0be5f100789f451641542a69cd719144d2 14-Jan-2012 Douglas Gregor <dgregor@apple.com> De-virtualize getPreviousDecl() and getMostRecentDecl() when we know
we have a redeclarable type, and only use the new virtual versions
(getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have
that type information. This keeps us from penalizing users with strict
type information (and is the moral equivalent of a "final" method).

Plus, settle on the names getPreviousDecl() and getMostRecentDecl()
throughout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2d6a5670465cb3f1d811695a9f23e372508240d2 14-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,
APValue::Array and APValue::MemberPointer. All APValue values can now be emitted
as constants.

Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other
entrypoints dealing with constant member pointers are no longer necessary and
will be removed in a later change.

Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to
VarDecl::evaluateValue. This performs caching and deals with the nasty cases in
C++11 where a non-const object's initializer can refer indirectly to
previously-initialized fields within the same object.

Building the intermediate APValue object incurs a measurable performance hit on
pathological testcases with huge initializer lists, so we continue to build IR
directly from the Expr nodes for array and record types outside of C++11.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1bf7a3fcc4e2ad30688f7b0db464ad1ccabe77e2 10-Jan-2012 Bill Wendling <isanbard@gmail.com> The `-fwritable-strings' flag doesn't make the backing store strings of all
CFStrings writable.

The strings (both Unicode and ASCII) should reside in a read-only section. E.g.,
__TEXT,__cstring instead of __DATA,__data. This is done by making the global
variable created for the strings constant despite the value of that flag.
<rdar://problem/10657500>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bd9482d859a74bf2c45ef8b8aedec61c0e1c8374 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
375bb1413c041055262c8a416f20d10474a5eda9 27-Dec-2011 Douglas Gregor <dgregor@apple.com> Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bcf6b98247bd3ac76c5edf706b1087a8d32c0320 19-Dec-2011 Rafael Espindola <rafael.espindola@gmail.com> Extend the fix for PR9614 to handle inline asm in the outer decl and
the inner decl being a builtin. This is needed to support the glibc headers
in fedora 16 (2.14).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
15de72cf580840c61e5704c2f8a2b56f9d0638e1 03-Dec-2011 Douglas Gregor <dgregor@apple.com> Introduce a module import declaration, so that we properly represent, e.g.,

__import_module__ std.vector;

in the AST.



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

Patch by Seth Cantrell.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
cc4889f72ec68319969ba51e214d9940eb9327e5 28-Oct-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix PR9614 for functions with the always_inline attribute. Try to keep
the common case (-O0, no always_inline) fast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a411d2f1ed4598a7a96a7befe07a9d9ee1a6efde 26-Oct-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix pr9614 by not emitting an available_externally function when it calls
itself via an asm label.

available_externally functions are supposed to correspond to an external
function, and that is not the case in the examples in pr9614.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1d236ab930816f5da27bade92904914c44b73b4c 15-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Replace vectors with arrays.

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

Start handling debug line and scope information better:

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

Finishes off the rest of rdar://10246360

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
28e06354b5d4dd539be6781e388ff27c0dffd807 12-Oct-2011 Eric Christopher <echristo@apple.com> Revert file/scope handling patches. gdb testing revealed a couple of bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4b2d5498729a74a8e952bdf762e6f2d8c6b52690 12-Oct-2011 Eric Christopher <echristo@apple.com> Start handling debug line and scope information better:

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

Finishes off the rest of rdar://10246360

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0628b724ff68105dc88af00a39f859447f22981e 08-Oct-2011 Ted Kremenek <kremenek@apple.com> Free 'TheTargetCodeGenInfo' in the class CodeGenModule. This looks like an obvious memory leak that was reported from LLDB devs. The comment indicates the leak is deliberate, but I have no idea why this needs to be so. Please comment/revert if you know otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d51e43af0b3a6897b971f316c4de2035ec82d1f2 06-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> CUDA: add -fcuda-is-device flag

This frontend-only flag is used by the IR generator to determine
whether to filter CUDA declarations for the host or for the device.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
11d77169555480ee0a04c6e5bc390d8fde41175d 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Pass from the parser the locations of selector identifiers when creating
objc method decls.

They are not stored in the AST yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d1e40d5389a4382cbebc97d54792f41ee0414af4 02-Oct-2011 John McCall <rjmccall@apple.com> Make -fobjc-nonfragile-abi the -cc1 default, since it's the
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.

This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.

Most, though, it involved a perl script to translate a ton
of test cases.

Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d6471f7c1921c7802804ce3ff6fe9768310f72b9 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename Diagnostic to DiagnosticsEngine as per issue 5397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
8c25fc584ce27d59df9923f153e8a132dde58d04 19-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: introduce support for function scope __local variables

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5584d91c938384b57563edbca5c2d4f1c66ff02a 19-Sep-2011 John McCall <rjmccall@apple.com> In apple-kext mode, use external linkage for explicit template instantiations
instead of internal linkage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a45680b7e7c49ea9893c6cff585984f3e4120366 14-Sep-2011 John McCall <rjmccall@apple.com> Correctly generate IR for casted "builtin" functions, where
the builtin is really just a predefined declaration. These are
totally valid to cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e289d81369914678db386f6aa86faf8f178e245d 13-Sep-2011 Douglas Gregor <dgregor@apple.com> Switch LangOptions over to a .def file that describes header of the
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.

AST serialization changes are next up.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
13db5cfc4e5f03eb70efe0d227b53b8280f16161 09-Sep-2011 John McCall <rjmccall@apple.com> Treat the weak export of block runtime symbols as a deployment-target
feature akin to the ARC runtime checks. Removes a terrible hack where
IR gen needed to find the declarations of those symbols in the translation
unit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ead363bdd2756efa945108941ab46bbde3bd8bdf 09-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Do a lookup for the blocks runtime globals to see if they were declared,
instead of codegen waiting to consume such a declaration, which won't
happen if that decls are coming from a PCH.

Fixes rdar://10028656.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
2873aee1774a2ae731d6cc5c5ee05ba82780dc98 23-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Make sure we don't inline functions marked with __attribute__((naked)). <rdar://problem/9973228>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138310 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
75cf3e86d33ce810c12084126385371b335c30ba 17-Aug-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Mark objc methods that are implicitly declared for properties (not user-declared) as implicit.
This results in libclang ignoring such methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f391dbe39dca85f2a2c6ea558811dacc571c223e 16-Aug-2011 Devang Patel <dpatel@apple.com> Finalize debug info after all deferred globals are emitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4111feff7ccefee4efda8832eb14a9e64b2ffc1a 16-Aug-2011 Devang Patel <dpatel@apple.com> Use new DIBuilder::finalize() at the end to wrap up debug info encoding for a translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0815b579b31cb3129f732bb7ea36fd6ba6949e98 09-Aug-2011 Douglas Gregor <dgregor@apple.com> Move the creation of the record type for the state of Objective-C fast
enumerations from the ASTContext into CodeGen, so that we don't need
to serialize it to AST files. This appears to be the last of the
low-hanging fruit for SpecialTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
45c4ea75b235de94f44bf96843624e6a559e4c00 09-Aug-2011 Douglas Gregor <dgregor@apple.com> Move the construction of the RecordDecl representing the runtime
layout of a constant NSString from the ASTContext over to CodeGen,
since this is solely CodeGen's responsibility. Eliminates one of the
unnecessary "special" types that we serialize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a5e19c6b2554f6d9c4b9850d4dbbbfa3643282e5 04-Aug-2011 John McCall <rjmccall@apple.com> Emit wide string literals with the appropriate alignment.
Patch by Craig Topper and Sundeep!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
40f9c302f23a35611cd354f40b22b37f2c554a40 03-Aug-2011 John McCall <rjmccall@apple.com> When rewriting a call to a K&R function to lead to a well-prototyped
function, be sure to drop parameter attributes when dropping their
associated arguments. Patch by Aaron Landwehr!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e926523105dd2604ccd5c101605dea43c5269965 27-Jul-2011 Peter Collingbourne <peter@pcc.me.uk> CodeGen: rename CodeGenModule::Runtime to ObjCRuntime

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5cee1195584fa8672253139c86e922daeda69b9e 27-Jul-2011 Douglas Gregor <dgregor@apple.com> Add support for C++0x unicode string and character literals, from Craig Topper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
642116259e8df6286063a17361c20e95b5017a0a 25-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Rename getInstantiationLineNumber to getExpansionLineNumber in both
SourceManager and FullSourceLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9f5bff086cad25c15b4deb8a7763786097aadccd 23-Jul-2011 Chris Lattner <sabre@nondot.org> fix PR10415, tidying up IR representation of module level inline asm
to avoid extraneous \n's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.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/CodeGenModule.cpp
db8264e4c5ffd7af6fbad4ca4306bd382bb02691 22-Jul-2011 Jordy Rose <jediknil@belkadan.com> Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.
This was previously not-const only because it has to lazily construct a chain
of ivars the first time it is called (and after the chain is invalidated).
In practice, all the clients were just const_casting their const Decls;
all those now-unnecessary const_casts have been removed.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dce67a70a86db8758c926a76fdd980f5369d5746 18-Jul-2011 Nick Lewycky <nicholas@mxc.ca> In C99, emit an inline function when encountering an extern redeclaration.
Fixes PR10233!


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
df983a8bcbbcea911b8dce283f044787df119d50 12-Jul-2011 Jay Foad <jay.foad@gmail.com> Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e455f1c32b9b35e28d2a4ab49beccb62f0d8d79d 12-Jul-2011 Bill Wendling <isanbard@gmail.com> Revert r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, line 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134888 into '.':
U lib/CodeGen/CodeGenModule.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
00d40eae546219786a74564fc0d95eab1978b82b 11-Jul-2011 Jay Foad <jay.foad@gmail.com> De-constify Types in FunctionType::get().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
dbd3c85825ad59896292ac7d326fe1985768f1e3 07-Jul-2011 Cameron Zwarich <zwarich@apple.com> r134634 causes a failure on MultiSource/Benchmarks/Olden/bh with TEST=nightly,
so roll it out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2357aeec0da2740838963880edd97e43f14cb6fd 07-Jul-2011 Nick Lewycky <nicholas@mxc.ca> A redeclaration of an inline method in C99 mode should trigger emission of that
function. Fixes PR10233!


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
08d4792bb5d9e0e7f122c6273636807029c06aaa 21-Jun-2011 Daniel Dunbar <daniel@zuster.org> IRgen: Add CGOptions to CGTypes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ab27d6ea7b4ce2762a16905281de796db32bb6f2 20-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> llvm-gcc treats a tentative definition with a previous
(or follow up) extern declaration with weak_import as
an actual definition. make clang follows this behavior.
// rdar://9538608
llvm-gcc treats an extern declaration with weak_import


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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7650d95a1a616ea300f37126a8dfc93dc19a662a 19-Jun-2011 Chris Lattner <sabre@nondot.org> update for api change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c7c9058f4977ef4584d68718e23f34504b150ef4 16-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Move computation of __private_extern__ visibilty to
getLVForNamespaceScopeDecl(). // rdar://9609649


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
119f19b46b79cbe48f1992911588a728dfa5ad2e 16-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Set the visibility to 'hidden' when previous
declaration of global var is __private_extern__.
// rdar://9609649


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
cb5d2d0647fdab2e36c85b417e03bf18916ce10c 10-Jun-2011 Eli Friedman <eli.friedman@gmail.com> PR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to determine whether the vtable should be externally visible, instead of a rough approximation of it which messes up with templates.

While I'm here, zap the other user of isInAnonymousNamespace outside of Decl.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6a576ab708d3aa7d40e5d867ab1de5d3cb507553 05-Jun-2011 Douglas Gregor <dgregor@apple.com> When inferring the result type of a block based on a return statement
with a type-dependent expression, infer the placeholder type
'Context.DependentTy' to indicate that this is just a
placeholder. Fixes PR9982 / <rdar://problem/9486685>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b0dd6702ab5e7f53a4bdab5a3371285ad2a4b20b 28-May-2011 Eli Friedman <eli.friedman@gmail.com> Match llvm-gcc's string literals alignment by forcing alignment on string literals to 1. This can significantly impact the size of the string data, and as far as I know, the alignment doesn't help performance. rdar://9078969 .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
abca5a1b3e74e644e297c7590b46ab73a6bb476a 25-May-2011 Rafael Espindola <rafael.espindola@gmail.com> Update for llvm api change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
25dba5d294364fa8339091e4d9e6a8f5db008377 18-May-2011 Fariborz Jahanian <fjahanian@apple.com> Code cleanup of my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6f40e2244b0590f144c5ceee07981a962fbbc72e 18-May-2011 Fariborz Jahanian <fjahanian@apple.com> Patch to fix IR-gen crash generating structure ABI which implements
user specified string class via -fconstant-string-class option.
pr9914.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0774cb84719f2aea3016493a2bbd9a02aa3e0541 15-May-2011 John McCall <rjmccall@apple.com> Use arrays and SmallVectors instead of std::vectors when building function
types. Also, cache a translation of 'void' in CGM and provide a ptrdiff_t
alias. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
62c296e1bd7581a444c2dc7ddb76f0bf2f364f23 14-May-2011 Joerg Sonnenberger <joerg@bec.de> Simplify


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4fe497d5cd34a7dca6e68b2e0a00fe2293570742 13-May-2011 Joerg Sonnenberger <joerg@bec.de> Bug 8765: Honor assembler labels for builtins. Ensure that the label is
mangled to avoid doing it twice for platforms that use prefixes like
Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
cf8e168baf75b7ede6493d0373d64545c29c1a90 13-May-2011 Fariborz Jahanian <fjahanian@apple.com> Produce UTF-8 strings with -fconstant-string-class
-fno-constant-cfstrings. Patch by Jonathan Schleifer.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2bb110125e0e5adb7c1c65d12adfa34151ca1c47 13-May-2011 Douglas Gregor <dgregor@apple.com> When determining whether we can make a declaration into a global
constant, also consider whether it's a class type that has any mutable
fields. If so, it can't be a global constant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
da55074866ca2fe7f718c5d3334648d6e340fb15 08-May-2011 Douglas Gregor <dgregor@apple.com> In C++, allow us to emit a global as 'constant' even if it has class
type, so long as it is known to have a constant initializer and the
class type is a POD class. Fixes <rdar://problem/9306265>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
10620eb5164e31208fcbf0437cd79ae535ed0559 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Modify some deleted function methods to better reflect reality:

- New isDefined() function checks for deletedness
- isThisDeclarationADefinition checks for deletedness
- New doesThisDeclarationHaveABody() does what
isThisDeclarationADefinition() used to do
- The IsDeleted bit is not propagated across redeclarations
- isDeleted() now checks the canoncial declaration
- New isDeletedAsWritten() does what it says on the tin.
- isUserProvided() now correct (thanks Richard!)

This fixes the bug that we weren't catching

void foo() = delete;
void foo() {}

as being a redefinition.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3e4c6c4c79a03f5cb0c4671d7c282d623c6dc35e 05-May-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for C++0x alias templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3dc05418538c719fea48b906bfa4febe5296e126 05-May-2011 Nick Lewycky <nicholas@mxc.ca> Preserve the full name of the file, so that '-c -o foo.pic.o' produces
foo.pic.gcno instead of foo.gcno.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5ea4f44e34449a78d6b38aa47c14b527839d7aac 04-May-2011 Nick Lewycky <nicholas@mxc.ca> Record where the GCOV data files should be placed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8387e2a41eef6fa17fb140a18c29b6eee9dd2b8a 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.

Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e8ba8d78a258ec992d3521eebdae8324db777b14 22-Apr-2011 Nick Lewycky <nicholas@mxc.ca> Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (at
compile time) and .gcda emission (at runtime). --coverage enables both.

This does not yet add the profile_rt library to the link step if -fprofile-arcs
is enabled when linking.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
db57a4cdb0a6abf3239f3a794a900ce312c5887b 19-Apr-2011 Daniel Dunbar <daniel@zuster.org> ADT/Triple: Switch to using .isOSDarwin() predicate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f7e903d7a30891083420c07ebeed281726a101d6 13-Apr-2011 Daniel Dunbar <daniel@zuster.org> IRgen/Obj-C: Emit CFStrings and NSStrings with the alignment of the char type,
there is no reason to align them higher.
- This roughly matches llvm-gcc's r126913.
- It is an open question whether or not we should do this for cstring's in
general (code size vs optimization potential), for now we just match llvm-gcc
until someone wants to run some experiments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
99ace16bc6962f1fc3dc45bbbdf2eb74e555a8ad 12-Apr-2011 John McCall <rjmccall@apple.com> Template static data members can have weak_odr linkage, not just
weak linkage. Also, fix a problem where global weak variables
with non-trivial initializers were getting guard variables, or at
least were checking for them and then crashing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
26fbc72b33bdbd20b0145bf117c64d373f8051e3 12-Apr-2011 John McCall <rjmccall@apple.com> Ignore indirect field declarations. Fixes PR9570.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
baf101d1f96b4e41c9f2797875329840514f54f1 09-Apr-2011 Chris Lattner <sabre@nondot.org> fix indentation


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0ac2cf4d28e1ed92508b27a3d9e28fc8db2a390b 06-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> If this is an intrinsic function, set the function's attributes to the intrinsic's attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4421d2b341d041df44013769f23c306308bbab83 26-Mar-2011 Douglas Gregor <dgregor@apple.com> On Mac OS X, the presence of an 'availability' attribute for that
platform implies default visibility. To achieve these, refactor our
lookup of explicit visibility so that we search for both an explicit
VisibilityAttr and an appropriate AvailabilityAttr, favoring the
VisibilityAttr if it is present.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e80d56771736c85fd8365c394a6731923b17e91d 23-Mar-2011 Devang Patel <dpatel@apple.com> Update type cache when a type is completed.
Radar 9168773


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0a0d2b179085a52c10402feebeb6db8b4d96a140 23-Mar-2011 Douglas Gregor <dgregor@apple.com> Implement a new 'availability' attribute, that allows one to specify
which versions of an OS provide a certain facility. For example,

void foo()
__attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));

says that the function "foo" was introduced in 10.2, deprecated in
10.4, and completely obsoleted in 10.6. This attribute ties in with
the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that
we want to deploy back to Mac OS X 10.1). There are several concrete
behaviors that this attribute enables, as illustrated with the
function foo() above:

- If we choose a deployment target >= Mac OS X 10.4, uses of "foo"
will result in a deprecation warning, as if we had placed
attribute((deprecated)) on it (but with a better diagnostic)
- If we choose a deployment target >= Mac OS X 10.6, uses of "foo"
will result in an "unavailable" warning (in C)/error (in C++), as
if we had placed attribute((unavailable)) on it
- If we choose a deployment target prior to 10.2, foo() is
weak-imported (if it is a kind of entity that can be weak
imported), as if we had placed the weak_import attribute on it.

Naturally, there can be multiple availability attributes on a
declaration, for different platforms; only the current platform
matters when checking availability attributes.

The only platforms this attribute currently works for are "ios" and
"macosx", since we already have -mxxxx-version-min flags for them and we
have experience there with macro tricks translating down to the
deprecated/unavailable/weak_import attributes. The end goal is to open
this up to other platforms, and even extension to other "platforms"
that are really libraries (say, through a #pragma clang
define_system), but that hasn't yet been designed and we may want to
shake out more issues with this narrower problem first.

Addresses <rdar://problem/6690412>.

As a drive-by bug-fix, if an entity is both deprecated and
unavailable, we only emit the "unavailable" diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
60be607e5d71627bf3dab8f51c3fdca74267c692 22-Mar-2011 David Chisnall <csdavec@swan.ac.uk> Simplify Mac runtime selection - it's the factory function's job to select which class to produce, not CodeGenModule's.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e81ac69c5da9fadfac33ee76e98d5fb558c4e389 22-Mar-2011 John McCall <rjmccall@apple.com> The emission of an Objective-C++'s class .cxx_destruct method should be
conditioned on whether it has any destructible ivars, not on whether
it has any non-trivial class-object initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
32096695c76033a6b0b1747c439f7378a11e8312 18-Mar-2011 John McCall <rjmccall@apple.com> The Darwin kernel does not provide useful guard variable support.
Issue this as an IR-gen error; it's not really worthwhile doing this
"right", i.e. in Sema, because IR gen knows a lot of tricks beyond
what the constant evaluator knows.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127854 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
827bbcc8a9115782693b21030a45378abe5c1862 17-Mar-2011 David Chisnall <csdavec@swan.ac.uk> Remove code that was intentionally generating bad code on the GNU runtime for no reason (failing to emit .cxx_constructor / .cxx_destructor methods).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dc0f137295bc7ec5b231ff1842388f149f43c0c8 14-Mar-2011 Rafael Espindola <rafael.espindola@gmail.com> Switch from internal to linker_private linkage, it is sufficient to please the new linker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
584acf2ded2c18a18d6da0e1c01f5859a384d99f 14-Mar-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix link of libxul with LTO and the linker in xcode4. It is not clear if this
is working around a bug in ld or if the new linker has a reasonable reason
for wanting the string constant to be linker visible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1f6f961293da9c2b1c23da2411c1b439a9502ed0 09-Mar-2011 John McCall <rjmccall@apple.com> Fix three of the four places where I left breadcrumbs to avoid unnecessary
recomputation.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5de7a0e8800b89780e565c1013e566414f11546a 07-Mar-2011 Devang Patel <dpatel@apple.com> Do not emit stop point for CXXDefaultArgExpr. It results in suboptimial user experience.

21 int main() {
22 A a;

For example, here user would expect to stop at line 22, even if A's constructor leads to a call through CXXDefaultArgExpr.

This fixes ostream-defined.exp regression from gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9de4342ef79a18c706e46bc23f8f579f5add2375 05-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> StringRefify.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
15e310a3b970b64a84cb30f0005bc396b4d978cb 19-Feb-2011 John McCall <rjmccall@apple.com> Warn about code that uses variables and functions with internal linkage
without defining them. This should be an error, but I'm paranoid about
"uses" that end up not actually requiring a definition. I'll revisit later.

Also, teach IR generation to not set internal linkage on variable
declarations, just for safety's sake. Doing so produces an invalid module
if the variable is not ultimately defined.

Also, fix several places in the test suite where we were using internal
functions without definitions.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c4850c2aa4c281a352e228aafc51fb1e30dcad02 11-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Use raw_svector_ostream in more places in the mangler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a29bf41b8f49578207ce36f6b21ff9bb7ee77bab 09-Feb-2011 Douglas Gregor <dgregor@apple.com> When IRgen refers to a function declaration that is not a definition,
and we later find the definition, make sure that we add the definition
(not the declaration) to the list of deferred definitions to
emit. Fixes PR8864.

Thanks to Nick Lewycky for testing this patch out



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
1faa89f9c619e4b2411fab4af7e22ee7a2bd9009 05-Feb-2011 Anders Carlsson <andersca@mac.com> Re-land r124768, with a fix for PR9130.

We now emit everything except unused implicit virtual member functions when building the vtable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
53bad4e98ed5e765df4231099bf1c737582908bf 04-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> minor refactoring of -fapple-kext stuff.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
fd0f89d3d7e4220327abdec1cb115474d70219dc 04-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> What was I thinking?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
142f9e99018a85105cee570133c111a52f2053ec 04-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> -fapple-kext cannot have 'weak' visibility in this
abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124834 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
01de7a44cea9f77cbcda65faad8edc8b48a3b617 03-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Revert 124768.
This reopens PR99114, but that one at least can be avoided with an #include.
PR9130 cannot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
aedd9d5ad3cc776fd61457050bcd54cac4c5ea66 03-Feb-2011 Anders Carlsson <andersca@mac.com> Don't try to mark virtual members referenced for classes where the key function
is not defined in the current translation unit. Doing so lead to compile errors
such as PR9114.

Instead, when CodeGen is building the vtable, don't try to emit a definition
for functions that aren't marked used in the current translation unit.
Fixes PR9114.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
071d3af0de273b1079d79f7f979264f28d567373 01-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Revert 124633. The linker has been told how to merge available_externally.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
517ebc6e13c41dc9115bc0eece93f6fc1155743e 01-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Set visibility for available_externally globals. This is important for two reasons:

* llvm-link would complains about mismatched visibility
* If we produce a relocation with an available_externally, it is good to know that
it is hidden.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6d7f8473cd6e967b3676948894ce72472102f9cb 30-Jan-2011 Anders Carlsson <andersca@mac.com> When building with optimizations, emit vtables where the key is not in the
current translation unit as available_externally.

This helps devirtualize the second example in PR3100, comment 18:

struct S { S() {}; virtual void xyzzy(); };
inline void foo(S *s) { s->xyzzy(); }
void bar() { S s; foo(&s); }

This involved four major changes:

1. In DefineUsedVTables, always mark virtual member functions as referenced for
non-template classes and class template specializations.
2. In CodeGenVTables::ShouldEmitVTableInThisTU return true if optimizations are
enabled, even if the key function is not implemented in this translation
unit. We don't ever do this for code compiled with -fapple-kext, because we
don't ever want to devirtualize virtual member function calls in that case.
3. Give the correct linkage for vtables where the key function is not defined.
4. Update the linkage for RTTI structures when necessary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c7e98fabd852e9dfa7409b7fc664b87322522c43 29-Jan-2011 Anders Carlsson <andersca@mac.com> Move GetLLVMVisibility to CodeGenModule.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9a86a137b0872bad25161fb3408a71d919638757 29-Jan-2011 Anders Carlsson <andersca@mac.com> Add RTTIBuilder::GetAddrOfTypeName which uses the newly added CreateOrReplaceCXXRuntimeVariable.

Set the visibility for typeinfo names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
fa2e99f72f9bfe2270ea8caf76d0eef11c45259f 29-Jan-2011 Anders Carlsson <andersca@mac.com> Change CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum instead of an "IsForRTTI" flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
934176f27552141b5ad113cb3603ffb14906c570 29-Jan-2011 Anders Carlsson <andersca@mac.com> Replace an isa/cast with a dyn_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0ffeaad72cb335b926b064379be4c9886bbff004 29-Jan-2011 Anders Carlsson <andersca@mac.com> Get rid of an unneeded parameter from setGlobalVisibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
96eaf2992b5955d1470fc9cce7a96e7e1e3b4ea7 29-Jan-2011 Anders Carlsson <andersca@mac.com> Use CGM.CreateOrReplaceCXXRuntimeVariable in CGVTables.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3bd6202ea2d5b5f7c8229cd280a846ae3dcf2355 29-Jan-2011 Anders Carlsson <andersca@mac.com> Add a new function, to be used by CGRTTI, CGVTables and CGVTT (which each has their own copy of this code).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3b8037a8c6f462e51f75c82b3d7fe1b8dbcf06c0 29-Jan-2011 Ken Dyck <kd@kendyck.com> Replace a literal '8' with getCharWidth().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c93a776c89bd0820813e5c7c87af2c820d9bbd27 29-Jan-2011 Anders Carlsson <andersca@mac.com> Remove IsDefinition from CodeGenModule::setTypeVisibility; it is always true.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f502d93b0ea970bfbd897e657f8d940a20984de2 24-Jan-2011 Anders Carlsson <andersca@mac.com> Mark VTables and RTTI data linkonce_odr instead of weak_odr, with the exception of explicit template instantiations, which have to be weak_odr.

This fixes PR6996.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
15f6765f6efd24bec4ec6f54e282c14193ef4014 22-Jan-2011 Benjamin Kramer <benny.kra@googlemail.com> Use a FunctionType::get overload that doesn't require an empty vector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c532b502858032f377056dc8cba2fe43cba8702b 18-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Add unnamed_addr in CreateRuntimeVariable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
06f486ecd05bd6788da97c39164c1903a084c26d 18-Jan-2011 Ken Dyck <ken.dyck@onsemi.com> Replace calls to CharUnits::fromQuantity() with ones to
ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123720 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d3d4e1ee398748468cbaaddb3b0af5953f043803 17-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> More unnamed_addr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
803d307a5385059b1a84dfe9706ab158c80a20dc 17-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> merge strings created by
const NSConstantString *appKey = @"MyApp";

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b266a1fce09ab4ee7033268199509aacfbef056a 17-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Add unnamed_addr to the special strings created by
__builtin___CFStringMakeConstantString
This fixes PR8993. A darwin expert might want to check that this is safe.

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

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

No (intended) functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b1c65ff108de47a89585ad37874bd6cb232664cd 11-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Set unnamed_addr for type infos that we are confortable marking as hidden. I
think it is safe to mark all type infos with unnamed_addr, but I am not sure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c5f657fe308f22243f674fc1dfbe24915944d8bf 11-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Add unnamed_addr to constructors and destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1257bc6ee76b931e3f8e51a88298b95379963d24 10-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Add unnamed_addr when creating artificial string globals. For example, in

static const char foo[] = "foo";
static const char *bar = "bar";

the global created to hold "bar" will have it, but foo will not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
bfdcdc8e26097c9dbb4c40d78296f6ccc3e6684c 15-Dec-2010 John McCall <rjmccall@apple.com> Set the "implicitly inline" bit on a method as soon as we see a definition
within the class. Teach IR gen to look for function definitions in record
lexical contexts when deciding whether to emit a function whose address
was taken. Fixes PR8789.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a6cf1e709b96865210b81bd611d41e9a2d41500a 02-Dec-2010 Eric Christopher <echristo@apple.com> Add support for the common and nocommon attributes.

rdar://8560647


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
112c967bd5c862a0f5d7913aa06700c048807db8 02-Nov-2010 John McCall <rjmccall@apple.com> Ensure that static local variables in function templates inherit the
visibility of their function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
af14603ca61757cf4361b583b45639a04c57e651 30-Oct-2010 John McCall <rjmccall@apple.com> Better solution: calculate the visibility of functions and variables
independently of whether they're definitions, then teach IR generation to
ignore non-explicit visibility when emitting declarations. Use this to
make sure that RTTI, vtables, and VTTs get the right visibility.

More of rdar://problem/8613093



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
110e8e56af30363072c140285961592b0107f789 30-Oct-2010 John McCall <rjmccall@apple.com> Restore r117644, this time properly ignoring -fvisibility and type visibility
for namespace-scope variable declarations.

Apply visibility in IR gen to variables that are merely declared
and never defined. We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
034f55c1eb93aee61cef5a015eb1d5ba06d3b3d4 29-Oct-2010 Daniel Dunbar <daniel@zuster.org> Revert r117644, "Apply visibility in IR gen to variables that are merely
declared", it breaks things.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
87a4ed905e2febe64021dcdfcdc7f00b27e92f32 29-Oct-2010 John McCall <rjmccall@apple.com> Apply visibility in IR gen to variables that are merely declared
and never defined. We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
354e712c81fbb07c0ce5f06180788b25fffa1b56 27-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Do the guarding of instantiated static data members
on if its linkage is weak. Currently this is the
case but may change in the future. (part of radar
8562966).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1fb0caaa7bef765b85972274e3b434af2572c141 22-Oct-2010 John McCall <rjmccall@apple.com> Substantially revise how clang computes the visibility of a declaration to
more closely parallel the computation of linkage. This gets us to a state
much closer to what gcc emits, modulo bugs, which will undoubtedly arise in
abundance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4c73307c74764ba99e1379677fe92af72f676531 19-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> This patch implements Next's IRGen for -fconstant-string-class=class-name.
PR6056, //rdar: //8564463



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0b5c4fc2ae3b503c2b1f354bf52b718aa50a6aee 15-Oct-2010 Dan Gohman <gohman@apple.com> Experimental TBAA support for enum types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4376c85fb0ac9e7fd779d246efc77e1169179138 15-Oct-2010 Dan Gohman <gohman@apple.com> Don't leak the TBAA object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3d5aff5d3036b0ff09d114857cd2276134b3d8c9 15-Oct-2010 Dan Gohman <gohman@apple.com> Experimental TBAA support.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2c6899fa1a748fe211280de3dfb478be56a9be6a 11-Oct-2010 NAKAMURA Takumi <geek4civic@gmail.com> lib/CodeGen/CodeGenModule.cpp: DLLImportLinkage should be processed also on declaration.

It enables clang to compile Mingw's headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dd0cb22bd62e1e835327f478a2dbf0b8fa439713 29-Sep-2010 Daniel Dunbar <daniel@zuster.org> Add support for attribute((naked)), patch by Zoxc on cfe-commits!
- Minor style tweaks by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3e9438b5251a547253d64169863c2909b9b2772a 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Kill FunctionDecl's IsCopyAssignment bit; it duplicated what could
already be determined by isCopyAssignmentOperator(), and was set too
late in the process for all clients to see the appropriate
value. Cleanup only; no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b25938303de0976b9f189363d43033e5788e3d36 16-Sep-2010 John McCall <rjmccall@apple.com> Opportunistically use the C++ personality function in ObjC++
translation units that don't catch ObjC types. rdar://problem/8434851



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e7ddfb974884ec75ffd66953b79511ea457493ba 07-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> get rid of a warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7da71020b97c69b95831bd03d35e8e8404bfdea0 07-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Have Sema check for validity of CGString literal
instead of asserting in IRGen. Fixes radar 8390459.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
d931b086984257de68868a64a235c2b4b34003fb 26-Aug-2010 John McCall <rjmccall@apple.com> De-memberify the VarDecl and FunctionDecl StorageClass enums.
This lets us remove Sema.h's dependency on Expr.h and Decl.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
000835d0b04345c0014c603fe6339b3bc154050e 23-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Support for IRGen of synthesize bitfield ivars in
objc-nonfragile-abi2 (radar 7824380).


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ee79a4c30e5d1c5285551c9a25b8ec6d45d46aa7 22-Aug-2010 John McCall <rjmccall@apple.com> The ARM C++ ABI is sufficiently different from the Itanium C++ ABI that
it deserves its own enumerator. Obviously the implementations should
closely follow the Itanium ABI except in cases of divergence.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
20cf717034ba1f20fc47c025ecb72ed9b631ad13 19-Aug-2010 Charles Davis <cdavis@mines.edu> Add some enum goodness as requested by Chris. Now instead of storing the
active C++ ABI as a raw string, we store it as an enum. This should improve
performance somewhat.

And yes, this time, I started from a clean build directory, and
all the tests passed. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
cf807c4dfdb23e8fa3f400e0b24ef5b79db7a530 19-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Generate Attr subclasses with TableGen.

Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.

Some other notes about newly-generated attribute classes:

- The constructor arguments are a SourceLocation and a Context&,
followed by the attributes arguments in the order that they were
defined in Attr.td

- Every argument in Attr.td has an appropriate accessor named getFoo,
and there are sometimes a few extra ones (such as to get the length
of a variadic argument).

Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2f4eaef37476ae6891ede8ba215d0f6fd093629b 17-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()
and remove getStrData(). Patch by Peter Davies (with some tweaks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
279b5eb6910d64a293e9c0e2887a05c65d8737d7 13-Aug-2010 John McCall <rjmccall@apple.com> Just disable the hidden-visibility optimization for now by hiding it behind
a -cc1 option. The Darwin linker complains about mixed visibility when linking
gcc-built objects with clang-built objects, and the optimization isn't really
that valuable. Platforms with less ornery linkers can feel free to enable this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
91f31dc234bbc98f3dd20e6741a7b0b98c7916bf 08-Aug-2010 Eric Christopher <echristo@apple.com> Thread local variables aren't considered common linkage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7a536907da776bdc47a704e7cafd641e8150e653 05-Aug-2010 John McCall <rjmccall@apple.com> It turns out that linkers (at least, the Darwin linker) don't necessarily
do the right thing with mixed-visibility symbols, so disable the visibility
optimization where that's possible, i.e. with template classes (since it's
possible that an arbitrary template might be subject to an explicit
instantiation elsewhere). 447.dealII actually does this.

I've put the code under an option that's currently not hooked up to anything.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
aa8b0d19244a6e7e8e5798fcc6aef003c274d3e0 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Implement #pragma GCC visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
cbfe50224b19119e759802bd0c1463269dffd09e 04-Aug-2010 John McCall <rjmccall@apple.com> Emit standard-library RTTI with external linkage, not weak_odr.

Apply hidden visibility to most RTTI; libstdc++ does not rely on exact
pointer equality for the type info (just the type info names). Apply
the same optimization to RTTI that we do to vtables.

Fixes PR5962.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4ac7c0bb39696e92fd220118fedc484c09a69870 29-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change the name to something less terrible; suggestion by Doug. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
90e99a84ddd020e8fda79643748243725a2ed071 29-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl
needs to be deserialized during PCH loading for codegen purposes.
Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext,
thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen.

This fixes current (and avoids future) codegen-from-PCH bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8670cd3ea4dfbf86caacd270ec2441e9949bbb6a 28-Jul-2010 Gabor Greif <ggreif@gmail.com> we are not supposed to create an improper callsite using a CallInstr; leave a fixme mentioning the simplification when CallSite can clone itself

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a6d6af308bfc9b72467b432a045a9fc6673e3821 28-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r109546, it broke linux build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ee94e2d10728d1b6a87a11aeee122e8759f58c63 28-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This function is part of the public CodeGen interface since it's essentially a CodeGen predicate that is also
needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes.
This fixes current (and avoids future) codegen-from-PCH bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3fe104154dd2e8ffb351142d74f308938b5c99bf 22-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> atch for implementation of objective-c's -Wselector
warning flag in clang. Little more to do
for a PCH issue. Radar 6507158.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
754b9fbaa13749c61393cc613eec7c79efe60ddf 16-Jul-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Support user defined attributes on block runtime functions.
- This issue here is that /usr/include/Blocks.h wants to define some of the
block runtime globals as weak, depending on the target. This doesn't work in
Clang because we aren't using the AST decl for these globals.

- The fix is a pretty gross hack which just watches all the decls for the
specific blocks globals we need to know about; if we see one we use it,
otherwise we use the hand coded type.

In time, I would like to clean this up by changing IRgen to ask Sema/AST for
the decl, which would then be lazily loaded from the builtin table if
necessary. This could be used in a whole host of places in IRgen and would
get rid of a lot of grotty hand coding of LLVM IR; however, we need some
extra Sema support for this as well as support for builtin global variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
673431a2986f750b4d8fadb57abf3f00db27bbbd 16-Jul-2010 Daniel Dunbar <daniel@zuster.org> IRgen: Move blocks runtime interfaces to CodeGenModule.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bf40cb518312dde1c07e44fcae59bc4eec65589c 16-Jul-2010 John McCall <rjmccall@apple.com> When deferring the emission of declarations with initializers in C++, remember
the order they appeared in the translation unit. If they get emitted, put them
in their proper order. Fixes rdar://problem/7458115



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7feaeeed1789fbf357fc81072966fe8f62fb4a81 16-Jul-2010 Douglas Gregor <dgregor@apple.com> Don't suppress the emission of available_externally functions marked
with always_inline attribute. Thanks to Howard for the tip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
44eac33ae12df384f3f002102f919f603bee330f 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Reinstate the optimization suppressing available_externally functions
at -O0. The only change from the previous patch is that we don't try
to generate virtual method thunks for an available_externally
function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
27cc6331e33efac4020058d2fda36c9060ec5afa 12-Jul-2010 Douglas Gregor <dgregor@apple.com> Speculatively revert r108156; it appears to be breaking self-host.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7ce1f2714ac0f33210bab14650bce2078ebf343e 12-Jul-2010 Douglas Gregor <dgregor@apple.com> Do not generate LLVM IR for available_externally function bodies at
-O0, since we won't be using the definitions for anything anyway. For
lib/System/Path.o when built in Debug+Asserts mode, this leads to a 4%
improvement in compile time (and suppresses 440 function bodies).

<rdar://problem/7987644>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
06a54a38be5054c910ffc92db60edab23f9ea105 07-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.

Makes de-serialization of the function body even more "lazier".

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

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



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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9a20d55807cc2f6534a9c51a46cc8143ed16786d 22-Jun-2010 Anders Carlsson <andersca@mac.com> Switch over to the new caching version of getMangledName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
793a990774826a0c20b0da66cec0991badfb8b63 22-Jun-2010 Anders Carlsson <andersca@mac.com> Add a new variant of getMangledName that caches the mangling for decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
af896897f7485176f43d40c4adced7efb0fb2b06 21-Jun-2010 Douglas Gregor <dgregor@apple.com> Instantiations subject to an explicit template instantiation
declaration have default visibility even under
-fvisibility=hidden. Fixes <rdar://problem/8109763>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
61c6c91930de9c0659027f019062b4a5636c1c2a 19-Jun-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR7415: refactor CodeGenModule::MayDeferGeneration and make it less
conservative for static variables in templated classes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
7cf84d66965a7706004d8590b5af5fe54b85f525 15-Jun-2010 Douglas Gregor <dgregor@apple.com> Implement -fvisibility-inlines-hidden. <rdar://problem/7819834>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
98b7c5c496dfccb39287b8f7d8f1444594936d10 11-Jun-2010 Charles Davis <cdavis@mines.edu> Add an option to specify the target C++ ABI to the frontend. Use it to
select either the default Itanium ABI or the new, experimental Microsoft ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9a8822bb154b792cdb18fe4cfb34480ca0ec7661 09-Jun-2010 Anders Carlsson <andersca@mac.com> Get rid of getMangledCXXCtorName and getMangledCXXDtorName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
afd04290de594111fe0f5917317e3a68e28639cf 09-Jun-2010 Anders Carlsson <andersca@mac.com> Get rid of an unnecessary getMangledName overload.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c76702cc80c1ef8a94d82b62ddcb4ed4f67d5b8c 27-May-2010 John McCall <rjmccall@apple.com> When deciding whether a deferred declaration has already been emitted,
aliases count as definitions regardless of whether their target has been
emitted yet. Fixes PR 7142.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3a811f1f4286ee3fd0c563c1cfe623956f3caa24 25-May-2010 Charles Davis <cdavis@mines.edu> IRgen: Add a stub class for generating ABI-specific C++ code.

This class only supports name mangling (which is apparently used during C/ObjC
codegen). For now only the Itanium C++ ABI is supported. Patches to add a
second C++ ABI are forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8b2423361648c39a7d8a3c5e8129e12006deac32 25-May-2010 John McCall <rjmccall@apple.com> If a function definition has any sort of weak linkage, its static local
variables should have that linkage. Otherwise, its static local
variables should have internal linkage. To avoid computing this excessively,
set a function's linkage before we emit code for it.

Previously we were assigning weak linkage to the static variables of
static inline functions in C++, with predictably terrible results. This
fixes that and also gives better linkage than 'weak' when merging is required.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1297fd72b1a3d7985c5c5e3e3a09b8acb2696358 13-May-2010 Douglas Gregor <dgregor@apple.com> Disable the available_externally optimization for inline virtual
methods for which the key function is guaranteed to be in another
translation unit. Unfortunately, this guarantee isn't the case when
dealing with shared libraries that fail to export these virtual method
definitions.

I'm reopening PR6747 so we can consider this again at a later point in
time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6fb745bdf1ff1e32caf07e42093a7920726892c1 13-May-2010 Douglas Gregor <dgregor@apple.com> Rework when and how vtables are emitted, by tracking where vtables are
"used" (e.g., we will refer to the vtable in the generated code) and
when they are defined (i.e., because we've seen the key function
definition). Previously, we were effectively tracking "potential
definitions" rather than uses, so we were a bit too eager about emitting
vtables for classes without key functions.

The new scheme:
- For every use of a vtable, Sema calls MarkVTableUsed() to indicate
the use. For example, this occurs when calling a virtual member
function of the class, defining a constructor of that class type,
dynamic_cast'ing from that type to a derived class, casting
to/through a virtual base class, etc.
- For every definition of a vtable, Sema calls MarkVTableUsed() to
indicate the definition. This happens at the end of the translation
unit for classes whose key function has been defined (so we can
delay computation of the key function; see PR6564), and will also
occur with explicit template instantiation definitions.
- For every vtable defined/used, we mark all of the virtual member
functions of that vtable as defined/used, unless we know that the key
function is in another translation unit. This instantiates virtual
member functions when needed.
- At the end of the translation unit, Sema tells CodeGen (via the
ASTConsumer) which vtables must be defined (CodeGen will define
them) and which may be used (for which CodeGen will define the
vtables lazily).

From a language perspective, both the old and the new schemes are
permissible: we're allowed to instantiate virtual member functions
whenever we want per the standard. However, all other C++ compilers
were more lazy than we were, and our eagerness was both a performance
issue (we instantiated too much) and a portability problem (we broke
Boost test cases, which now pass).

Notes:
(1) There's a ton of churn in the tests, because the order in which
vtables get emitted to IR has changed. I've tried to isolate some of
the larger tests from these issues.
(2) Some diagnostics related to
implicitly-instantiated/implicitly-defined virtual member functions
have moved to the point of first use/definition. It's better this
way.
(3) I could use a review of the places where we MarkVTableUsed, to
see if I missed any place where the language effectively requires a
vtable.

Fixes PR7114 and PR6564.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b0769101ac05792ccc539bc7359b1927b3fd4aca 07-May-2010 Douglas Gregor <dgregor@apple.com> Do not give implicitly-defined virtual members functions
available_externally linkage, since they may not have been given a
strong definition in another translation unit. Without this patch, the
following test case fails to link with a GCC-compiled libstdc++:

#include <sstream>
int main() { std::basic_stringbuf<char> bs; }

Fixes the last problem with the Boost.IO library.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c446d1816f46a4b6d2337102dfc001f55fc18211 05-May-2010 Douglas Gregor <dgregor@apple.com> When we emit a non-constant initializer for a global variable of
reference type, make sure that the initializer we build is the
of the appropriate type for the *reference*, not for the thing that it
refers to. Fixes PR7050.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
784f21121a6c9418ebd86baa6814e36e1176c410 28-Apr-2010 John McCall <rjmccall@apple.com> Properly pass the address of a lazily-generated function declaration with
incomplete type. Fixes PR6911.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102473 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ec951e0c2fc0db00c36bc60c900331dde32c1b43 24-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More -fno-constant-cfstrings API work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2bb5ddaff86ee73d2cea7ec1835978afc88a83f0 23-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More work toward implementing
NeXt's -fno-constant-cfstrings - wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
33e982bf782d851bfe5767acb1336fcf3419ac6b 22-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Support for -fno-constant-cfstrings option - wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b1af4c810fbf71d70d356c6244b157784e0d1405 19-Apr-2010 Rafael Espindola <rafael.espindola@gmail.com> Add comment explaning the use of c99 inline in c++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
cb421fa690da545b58a720abe5f1c49b166dbde7 19-Apr-2010 Dan Gohman <gohman@apple.com> Fix -Wcast-qual warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b8cab18e8562994b87f8d7c06f8c122beb712677 19-Apr-2010 Rafael Espindola <rafael.espindola@gmail.com> If a method is virtual and the class key function is in another file, emit the method as available_externally.
Fixes PR6747


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
b5e8156ebd6accd27daeaae6971597c45d5e5139 13-Apr-2010 Chris Lattner <sabre@nondot.org> unbreak tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4357a8291d759f6f9c36d3edeee8476d3eaf0804 13-Apr-2010 Chris Lattner <sabre@nondot.org> minor cleanups


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dbf02bccc9fc1115cb7dd45c84df77252d68f220 10-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Fix use after free. Incrementing an use_iterator after its user is erased is unsafe.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
35db3b9aad1829a1279b9e213ddee36395314a0b 10-Apr-2010 Gabor Greif <ggreif@gmail.com> rely even less on CallInst internals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6ba728d9687b2617793f5afd410650a8d6c71080 10-Apr-2010 Gabor Greif <ggreif@gmail.com> do not rely on CallInst interna, use CallSite to access arguments

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6ae1f35cedb5a847f15f86bdb227b7bbe574a344 10-Apr-2010 John McCall <rjmccall@apple.com> Provide an extremely unsatisfactory diagnostic (instead of crashing) when
mangling an unknown expression kind. Also conveniently tells the user what
kind of expression they should add to the mangler!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1e201b4a9d4880c3f90ab77e8a308140f003c7da 08-Apr-2010 Douglas Gregor <dgregor@apple.com> Eliminate excessive PCH deserialization caused by the search for
__cxxabiv1::__fundamental_type_info in every translation
unit. Previously, we would perform name lookup for
__cxxabiv1::__fundamental_type_info at the end of IRGen for a each
translation unit, to determine whether it was present. If so, we we
produce type information for all of the fundamental types. However,
this name lookup causes PCH deserialization of a significant part of the
translation unit, which has a woeful impact on performance.

With this change, we now look at each record type after we've
generated its vtable to see if it is
__cxxabiv1::__fundamental_type_info. If so, we generate type info for
all of the fundamental types. This works because
__cxxabiv1::__fundamental_type_info should always have a key function
(typically the virtual destructor), that will be defined once in the
support library. The fundamental type information will end up there.

Fixes <rdar://problem/7840011>.



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


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c60346388d60b1756f3675dabb60dc58da0728ec 01-Apr-2010 Chris Lattner <sabre@nondot.org> adjust to IRBuilder change and use faster DebugLoc apis.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
aaa210cf82141968b59eff28ae448d0e383c46a3 31-Mar-2010 Chris Lattner <sabre@nondot.org> use the new optimized debug info metadata accessors. In
addition to the inherent win, this eliminates the pointless
cost of going through the name -> mdkind stringmap that we
were paying.


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d1a5c31b78997befe75d10a4731cee4ab211cc31 27-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> When given the magic class __cxxabiv1::__fundamental_type_info, produce
the typeinfo for the fundamental types.

Fixes PR6685.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f075b229643aa07389a6055352ade7446241c3ca 23-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> revert 99311. Looks like it broke darwin bootstrap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5fb12c6c8f64d4b69f65faefb7d0800d7e4bca66 23-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Avoid producing implicit methods when we have a explicit template instantiation
declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7270ee4cd4794281c09dfb6931a98bbb2581ef02 23-Mar-2010 Anders Carlsson <andersca@mac.com> Always emit associated thunks when emitting the function itself. Remove getVtableAddressPoint, it's not used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
13189d0a184cac98b00ad7d7ee93481633af46cc 23-Mar-2010 Anders Carlsson <andersca@mac.com> Rename MaybeEmitVtable to EmitVTableRelatedData in preparation for making it emit thunks as well.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f746aa6a8f538be914173a4aef2d9a2fd9f99d17 20-Mar-2010 John McCall <rjmccall@apple.com> Change CodeGenModule to rely on the Module's symbol table instead of
shadowing it in the GlobalDeclMap. Eliminates the string-uniquing
requirement for mangled names, which should help C++ codegen times a little.
Forces us to do string lookups instead of pointer lookups, which might hurt
codegen times a little across the board. We'll see how it plays out.

Removing the string-uniquing requirement implicitly fixes any bugs like
PR6635 which arose from the fact that we had multiple uniquing tables for
different kinds of identifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8f51a4f2d00b0abda3cde7f3828fb2e2b9beafb5 13-Mar-2010 Douglas Gregor <dgregor@apple.com> Give explicit template instantiations weak ODR linkage. Former
iterations of this patch gave explicit template instantiation
link-once ODR linkage, which permitted the back end to eliminate
unused symbols. Weak ODR linkage still requires the symbols to be
generated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
34fd284e0a6ea88b98d6e1183548264bab5b3702 13-Mar-2010 Douglas Gregor <dgregor@apple.com> Re-revert the explicit template instantiation linkage patch. I am beginning to look incompetent

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8721360da5cf3d5dfdc2fc2bf8d53a5f79307995 13-Mar-2010 Douglas Gregor <dgregor@apple.com> Reinstate patch to turn explicit template instantiations into weak symbols

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4ea9006629acb6bf9b2984554517c968a10a6b77 12-Mar-2010 Douglas Gregor <dgregor@apple.com> Revert the linkage change for explicit template instantiations; something is amiss

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98332 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e5e0c9deb1b4cfa081152cda548d31368facbc57 12-Mar-2010 Douglas Gregor <dgregor@apple.com> Give explicit template instantiations weak linkage (but don't defer
them). Fixes PR6578.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bbf58bb1b8dd8c5e0f07547a6c20ffd55385fcf6 10-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Delay codegen of vtables when handling implicit instantiations.

This fixes PR6474.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d3a344c55b89bad933c04ac59650f7afb95423e9 06-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Add a message to these asserts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6374c3307e2d73348f7b8cc73eeeb0998ad0ac94 06-Mar-2010 John McCall <rjmccall@apple.com> Implement __builtin_dwarf_sp_column for i386 (Darwin and not), x86-64 (all),
and ARM. Implement __builtin_init_dwarf_reg_size_table for i386 (both) and
x86-64 (all).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6a836706c40a31c716952b74785102c90fd6afa7 04-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Fix PR6473.

Clang's support for weakref is now better than llvm-gcc's :-)

We don't introduce a new symbol and we correctly mark undefined references weak only if there is no
definition or regular undefined references in the same file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
468ec6c0266e48fccb26ce50d5b915c645bb3c7b 04-Mar-2010 John McCall <rjmccall@apple.com> Revert changes r97693, r97700, and r97718.

Our testing framework can't deal with disabled targets yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4819ac44c0e5222ebfe8e199c51f653f52177336 04-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Refactor local class name mangling and make it
ABI conforming.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c9fe644675503894e9e76e8ecd8e6519426548de 04-Mar-2010 John McCall <rjmccall@apple.com> Create a TargetMachine whenever we create a CodeGenAction. The codegen of
some builtins will rely on target knowledge.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7b9a5aa7c0d76f577699d25ce6afe21ecccb60b7 02-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> During codegen assert that any copy assignment, destructor or constructor that
we need to synthesize has been marked as used by Sema.

Change Sema to avoid these asserts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
11e8ce7380856abee188b237c2600272df2ed09d 23-Feb-2010 Rafael Espindola <rafael.espindola@gmail.com> Add support for the weakref attribute. We still produce "alias weak" as llvm-gcc does, but are more strict on what uses of weakref we accept.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
d46f98573ba104eda102dd3224b2dca69f1c6336 19-Feb-2010 John McCall <rjmccall@apple.com> Re-introduce the ctor/dtor alias optimization, this time hidden behind a
command-line option which defaults off.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8e51a1f5da6ef4a1a168d14116c6eed3a578a263 18-Feb-2010 John McCall <rjmccall@apple.com> Revert the ctor/dtor alias optimization for now; the buildbots can detect
some failure here that I can't.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
92ac9ffecd236a6be0d6ab30cef56100e56b171c 17-Feb-2010 John McCall <rjmccall@apple.com> Emit complete constructors and destructors as aliases to base constructors
and destructors when the two entities are semantically identical, i.e. when
the class has no virtual base classes. We only do this for linkage types
for which aliases are supported, i.e. internal and external, i.e. not linkonce.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3d2c43e9a7ca55f5ddc1f0c77d8f5e5ea7c1b573 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Remove use of 'std::string' from Attr objects, using instead a byte
array allocated using the allocator in ASTContext. This addresses
these strings getting leaked when using a BumpPtrAllocator (in
ASTContext).

Fixes: <rdar://problem/7636765>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
88786862424cb2d478516d911709dc19c962af9c 08-Feb-2010 John McCall <rjmccall@apple.com> Emit global references with constant initializers as constants. Fixes PR5585.

The standard actually says that such references should have internal linkage,
but gcc doesn't do that, so we probably can't get away with it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
39de84d671bac60662251e98f20a5a6039795dfc 07-Feb-2010 Anders Carlsson <andersca@mac.com> Improved handling of the visibility attribute. Declarations now inherit their parent's visibility.

(This is kind of a risky change, but I did a self-host build and everything appears to work fine!)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95511 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a9a55c063e9e59c6ab0a6d7a21302660f7bde9f9 06-Feb-2010 Douglas Gregor <dgregor@apple.com> Switch CodeGen's "is this variable declaration a definition?" logic
over to VarDecl::isThisDeclarationADefinition(), which handles
variables declared with linkage specifications better (among other
things). CMake 2.9 (from CVS) now builds with clang++ and is somewhat
functional.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
0b6bc8bd7a1d2a7d7478d13d78cff94cacad61fc 03-Feb-2010 Douglas Gregor <dgregor@apple.com> When a function or variable somehow depends on a type or declaration
that is in an anonymous namespace, give that function or variable
internal linkage.

This change models an oddity of the C++ standard, where names declared
in an anonymous namespace have external linkage but, because anonymous
namespace are really "uniquely-named" namespaces, the names cannot be
referenced from other translation units. That means that they have
external linkage for semantic analysis, but the only sensible
implementation for code generation is to give them internal
linkage. We now model this notion via the UniqueExternalLinkage
linkage type. There are several changes here:

- Extended NamedDecl::getLinkage() to produce UniqueExternalLinkage
when the declaration is in an anonymous namespace.
- Added Type::getLinkage() to determine the linkage of a type, which
is defined as the minimum linkage of the types (when we're dealing
with a compound type that is not a struct/class/union).
- Extended NamedDecl::getLinkage() to consider the linkage of the
template arguments and template parameters of function template
specializations and class template specializations.
- Taught code generation to rely on NamedDecl::getLinkage() when
determining the linkage of variables and functions, also
considering the linkage of the types of those variables and
functions (C++ only). Map UniqueExternalLinkage to internal
linkage, taking out the explicit checks for
isInAnonymousNamespace().

This fixes much of PR5792, which, as discovered by Anders Carlsson, is
actually the reason behind the pass-manager assertion that causes the
majority of clang-on-clang regression test failures. With this fix,
Clang-built-Clang+LLVM passes 88% of its regression tests (up from
67%). The specific numbers are:

LLVM:
Expected Passes : 4006
Expected Failures : 32
Unsupported Tests : 40
Unexpected Failures: 736

Clang:
Expected Passes : 1903
Expected Failures : 14
Unexpected Failures: 75

Overall:
Expected Passes : 5909
Expected Failures : 46
Unsupported Tests : 40
Unexpected Failures: 811

Still to do:
- Improve testing
- Check whether we should allow the presence of types with
InternalLinkage (in addition to UniqueExternalLinkage) given
variables/functions internal linkage in C++, as mentioned in
PR5792.
- Determine how expensive the getLinkage() calls are in practice;
consider caching the result in NamedDecl.
- Assess the feasibility of Chris's idea in comment #1 of PR5792.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b9f709665a6fe9da5c67d0431de2e63c55dd5322 01-Feb-2010 Chris Lattner <sabre@nondot.org> Don't explicitly force utf strings into the __TEXT,__ustring
by setting the section of the generated global. This is an
optimization done by the code generator, and the code being
removed didn't handle the case when the string contained an
embedded nul (which the code generator does correctly
handle). This is rdar://7589850



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
31310a21fb2a9f13950f864f681c86080b05d5b2 01-Feb-2010 Sebastian Redl <sebastian.redl@getdesigned.at> In C++, an initializer on a variable doesn't necessarily mean it's the definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8b752f10c394b140f9ef89e049cbad1a7676fc25 27-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Change the return type of ASTContext::getDeclAlignInBytes() to CharUnits and,
now that the "InBytes" part of the name is implied by the return type, rename
it to getDeclAlign().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4da244c23d6093adbbbc41654aa5c5111b38f431 26-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Use CharUnits for alignment of UTF16 string in GetAddrOfConstantCFString().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3bb92693c3332c1e99870a4e45afff3892e1c6ae 26-Jan-2010 Anders Carlsson <andersca@mac.com> Use the right definition when emitting a global variable. Fixes PR5564.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
687cc4a850b59116efee061018f0d8df50728b82 26-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Introduce CodeGenModule::GetTargetTypeStoreSize() to calculate the store size
of LLVM types in character units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d0c4792ca6bde9d60002760c10eb605ed2eebde8 26-Jan-2010 Anders Carlsson <andersca@mac.com> If a global variable has an initializer with side effects, it can never be deferred (even if it's in an anonymous namespace).

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
82d0a418c8699fc6f4a9417457ffe93d43bba1c1 10-Jan-2010 Anton Korobeynikov <asl@math.spbu.ru> Generalize target weirdness handling having proper layering in mind:
1. Add helper class for sema checks for target attributes
2. Add helper class for codegen of target attributes

As a proof-of-concept - implement msp430's 'interrupt' attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
031421bc8f641dcfea110eda1492fe13e1292d1e 09-Jan-2010 Chris Lattner <sabre@nondot.org> revert r92749, which is just dead code.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dffb8010a130733f1b55acf0af01deb0a2e083d3 06-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix linkage for RTTI names by re-using the logic for computing the
linkage of vtables. Before this, we were emitting RTTI names for
template instantiations with strong external linkage rather than with
weak ODR linkage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4b0f21c0f8bed0e2a7dc62d73be64e7e277d6c9a 06-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix marking of virtual members for nested classes whose first non-pure virtual function has a body inlined in the class

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bd6d6197fcfc98356ea60e816365eb0648b69556 05-Jan-2010 Douglas Gregor <dgregor@apple.com> Improve key-function computation for templates. In particular:
- All classes can have a key function; templates don't change that.
non-template classes when computing the key function.
- We always mark all of the virtual member functions of class
template instantiations.
- The vtable for an instantiation of a class template has weak
linkage.

We could probably use available_externally linkage for vtables of
classes instantiated by explicit instantiation declarations (extern
templates), but GCC doesn't do this and I'm not 100% that the ABI
permits it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ef372018c2dc0f8c2e5c34698401b87077eef6ed 05-Jan-2010 Mike Stump <mrs@apple.com> Add code to skip the emission of available externally functions at -O0. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1280708c17d373762ea4110b4f989d6c7239f6fb 29-Dec-2009 Chris Lattner <sabre@nondot.org> strength reduce this call away.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d5b8902c0329d80a216803b58dc3b689349a0c11 28-Dec-2009 Chris Lattner <sabre@nondot.org> this form of SetDebugLocation is about to go away, add some #includes that
are about to not come in implicitly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ab189950908fc08dd2533692f0e8253e807c73ac 25-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Some small improvements to dead code elimination; helps a bit on
LLVM-Code-Symbols test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9f61aa9e280adea9fbf3365f0e4f6ed568c9885a 12-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
20e098b7e7fda6bed1d67441b56cce77cd3aa918 11-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5714: make sure globals that will be modified aren't marked const.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8d04258483be6583f0865464234d014807a3e1cc 11-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Random string-related cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
548e60efea9a1d2c31679e11e9ff0d2f19b96694 10-Dec-2009 Anders Carlsson <andersca@mac.com> Make sure that explicitly instantiated functions get the right linkage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
386ca78d0b03b1fb519e60d1a14cd12a220364a6 09-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5709: use the computed type of the declaration instead of the
type of the builtin when generating the function declaration for a builtin
library call.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
61eab8872168af6eb1e0047a82901096cf145e27 08-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Misc key function fixes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b455f0e74be0144ab9738ef574d07bd661959525 08-Dec-2009 Eli Friedman <eli.friedman@gmail.com> A bunch more thunk fixes from misc testing.

(Yes, I do intend to commit some tests for this.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
72649ed78a25365d003b5218cae7b332c418800e 06-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Work-in-progess rewrite of thunks: move thunk generation outside of vtable
generation, and make sure we generate thunks when the function is defined
rather than when the vtable is defined.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
20f12a20ba9cfa6f8d53c8304e24f50903c45184 06-Dec-2009 Anders Carlsson <andersca@mac.com> Add rudimentary support for member pointers to CGDebugInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90711 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1b3171dd6c7c319655f79de80ed8fed03f758e51 05-Dec-2009 Anders Carlsson <andersca@mac.com> Don't emit explicit specializations of static member variable declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1a5e0d7f18485e4fb958f96dcddff3e4486a4069 01-Dec-2009 Anders Carlsson <andersca@mac.com> Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1bc5c03a7f08b04f4ac26abd705418aaf4109062 30-Nov-2009 Daniel Dunbar <daniel@zuster.org> Don't try to generate common globals for C++ files, instead of depending on the FE to set NoCommon, and simplify CodeGenOptions initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
15233e5a4d98b66b3c6cfcc4e6413ad776a79481 26-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Simplify and fix up the handling of implicit constructors, copy assignment
operators, and destructors. Avoids generating declarations/definitions of
trivial constructors/destructors, and makes sure the trivial copy assignment
operator is generated when necessary.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bd94ab9a19cb4bed55ecae9558533da9606bedcf 26-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Use new getLinkage() method to correctly compute whether a variable has
internal linkage. Fixes PR5433.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1fe598c026dc03fddbd65efb8119eb1afd9b1520 24-Nov-2009 Anders Carlsson <andersca@mac.com> Ignore constructor member templates in CodeGenModule::EmitTopLevelDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f981bf84ad7745861bc9c971f46417527e1e5db5 21-Nov-2009 Daniel Dunbar <daniel@zuster.org> Mangler: Lift shouldMangleDeclName predicate out of CXXNameMangler::mangle.
- Sometimes we have to mangle things we wouldn't normally (e.g., because they appear in a template expression).

- This also tidies up the predicate to be more obvious what is getting mangled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
94fd26de3ae77f29496ca22d5276b2fb71b2311d 21-Nov-2009 Daniel Dunbar <daniel@zuster.org> IRgen: Switch the C++ mangler interfaces to take the SmallVector to write into,
instead of requiring clients to make a raw_svector_ostream, which is just an
implementation detail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1b0771170921b9e752a50ea2cf87814bff92c834 21-Nov-2009 Daniel Dunbar <daniel@zuster.org> Sink free mangle* methods into MangleContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bbd37c62e34db3f5a95c899723484a76c71d7757 21-Nov-2009 Sean Hunt <rideau3@gmail.com> Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
- align() - semantics believed to be conformant to n3000, except for
redeclarations and what entities it may apply to
- final - semantics believed to be conformant to CWG issue 817's proposed
wording, except for redeclarations
- noreturn - semantics believed to be conformant to n3000, except for
redeclarations
- carries_dependency - currently ignored (this is an optimization hint)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a84b4044b79f2cc424c6ae7ee5edb97e948ba806 20-Nov-2009 Mike Stump <mrs@apple.com> Fixup key function calculations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
58588943a8283baf17815d56275bdb381560970c 19-Nov-2009 Mike Stump <mrs@apple.com> Improve instantiation control for rtti data and allow key functions to
instantiate a class. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9d0c6613ec040ad8d952556be909232a7f25dede 17-Nov-2009 John McCall <rjmccall@apple.com> Skip over shadow using decls during codegen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
7eb79c1010c8d30b852768bec96e81cd3e6def2e 16-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Make GetAddrOfConstantStringFromLiteral return a constant of the correct type.
This doesn't have any visible effects at the moment because normally the
implicit cast code forces the type to the expected type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
654ad40f27d684e8f3eddbc990247a6dbea5dded 09-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Rearrange function to avoid recursive use-after-free.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
78f7ece00e2ddfb64d4ed72a7be770b5b9b805e3 07-Nov-2009 Chris Lattner <sabre@nondot.org> add missing #include


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
393c247fe025ccb5f914e37e948192ea86faef8c 05-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Added support for static variables which require
initialization before main. Fixes pr5396.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7d9c3c92c90ae36d58ec21bc53c4c08e02ac3555 28-Oct-2009 Douglas Gregor <dgregor@apple.com> Implement proper linkage for explicit instantiation declarations of
inlined functions. For example, given

template<typename T>
class string {
unsigned Len;

public:
unsigned size() const { return Len; }
};

extern template class string<char>;

we now give the instantiation of string<char>::size
available_externally linkage (if it is ever instantiated!), as
permitted by the C++0x standard.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7ced9c8529b734e313f62a3b81189d6f402f6713 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Introduce FunctionDecl::isInlined() to tell whether a function should
be inlined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0130f3cc4ccd5f46361c48d5fe94133d74619424 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Rename FunctionDecl::isInline/setInline to
FunctionDecl::isInlineSpecified/setInlineSpecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8e2efcc267ed12dc435782288b7f9a4a1bc56c72 27-Oct-2009 Anders Carlsson <andersca@mac.com> Add a PrettyStackTraceDecl in CodeGenModule::EmitGlobalDefinition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9f0306d969700c9d79a31d559f95a1eb4c0bfcb4 26-Oct-2009 Douglas Gregor <dgregor@apple.com> assert -> llvm_unreachable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e013d685c6689ac7ae103ee88acf573422d1ed6a 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move clients to use IdentifierInfo::getNameStart() instead of getName()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a0f00a71fcb0f98298709d5e5318339acf7958ac 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Fix a thinko that John pointed out

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1028c9f0afc1cc5f4951b39b7067fa57c1fea07b 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Give explicit and implicit instantiations of static data members of
class templates the proper linkage.

Daniel, please look over the CodeGenModule bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
aa40454a14837c573f323e29269cc0b53f495a13 14-Oct-2009 Devang Patel <dpatel@apple.com> Copy metadata associated with CI


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
278b9f06933c385ffbccc15f8491787470cb4a1b 14-Oct-2009 Chris Lattner <sabre@nondot.org> fix some cfstring related issues:
1) -fwritable-string does affect the non-utf16 version of cfstrings
just not the utf16 ones.
2) utf16 strings should always be marked constant, as the __TEXT segment
is readonly.
3) The name of the global doesn't matter, remove it from TargetInfo.
4) Trust the asmprinter to drop cstrings into the right section, like llvmgcc does now.

This fixes rdar://7115750



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
00549fcec0490b2daf27543e532f94adbb186063 14-Oct-2009 Chris Lattner <sabre@nondot.org> unbreak test/CodeGen/builtins.c, reverting Devang's change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9c0957069f3a92c5ee1e3da630ef360eca5b2061 14-Oct-2009 Devang Patel <dpatel@apple.com> Check void type before using replaceAllUsesWith().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
70cf5306f0ae9a36642858fdaa4ce7ff8194a20d 13-Oct-2009 Devang Patel <dpatel@apple.com> Remove extra white space line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3b122bc5f1203615e2128e0c1a63da438865b1cc 13-Oct-2009 Devang Patel <dpatel@apple.com> Do not check use_empty() before invoking replaceAllUsesWith().
Let replaceAllUsesWith() adjust VHs even though there are no uses.



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


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
74d644abe56809d9bcea7311f37aa9063ab9e064 08-Oct-2009 Anders Carlsson <andersca@mac.com> If a global initializer has a non-trivial constructor or destructor, we never want to defer generation of it, even if it is declared static.

With this change we're finally able to compile and run the (infamous)

#include <string>
#include <iostream>

int main(int argc, char **argv) {
std::cout << "Hello, World" << std::endl;
}

$ clang hello.cpp -lstdc++ -o hello
$ ./hello
Hello, World



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b540491851910c2efa68196a8bdc2eed1071c17d 07-Oct-2009 Anders Carlsson <andersca@mac.com> Add a MangleContext and pass it to all mangle functions. It will be used for keeping state, such as identifiers assigned to anonymous structs as well as scope encoding.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bd6dbd19781cefd5b5ff9750c8bf86e6c341a68c 06-Oct-2009 Mike Stump <mrs@apple.com> Fix thinko and simplify.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
fb51ddfafcd5f8536d0312b3daa3c0b74b90ab5b 06-Oct-2009 Mike Stump <mrs@apple.com> Ensure we have atleast 2-byte alignment for member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f55314dce992fd60816ba337ad151a2fb7c42239 05-Oct-2009 Mike Stump <mrs@apple.com> Respect alignments better.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
9aeed32282fe8a775c24c01c923717ca86695685 01-Oct-2009 John McCall <rjmccall@apple.com> Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
apparently because using directives aren't quite working correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
018837b081bd1a725bae1c020eb1649975b04d67 23-Sep-2009 Anders Carlsson <andersca@mac.com> Handle namespace aliases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f015b034159d40e7033309e50036804eb1971787 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Revert "Switch a few clients over to StringLiteral::getString.", this is breaking some projects, but I don't have a test case yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
df4eee9b035cc4b95b1ea72635e7429d06b0ecc8 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Switch a few clients over to StringLiteral::getString.
- Switching all of them out-of-my-current-scope-of-interest, sorry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
34771b594ca8cdf8cd2e40b27170efa4ed2833c5 14-Sep-2009 Daniel Dunbar <daniel@zuster.org> Fix subtle bug in generating LLVM function declarations for builtin functions.

The decl wasn't being passed down, which meant that function attributes were not
being set correctly. This is particularly important for ARM, since it wants to
override the calling convention. Instead we would emit the builtin with the
wrong calling convention, and instcombine would come along and merrily shred all
the calls to it. :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1fc09a92d0bffda20e06fa882388c01e192e2069 13-Sep-2009 Douglas Gregor <dgregor@apple.com> Rework the way we determine whether an externally visible symbol is
generated for an inline function definition, taking into account C99
and GNU inline/extern inline semantics. This solution is simpler,
cleaner, and fixes PR4536.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
48a83b5e7ae4051c7c11680ac00c1fa02d610a62 12-Sep-2009 Douglas Gregor <dgregor@apple.com> Remove unnecessary ASTContext parameters from isMain and isExternC

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4a6835e650ff24e19ce08a3bd347c0ad186777fd 11-Sep-2009 Anders Carlsson <andersca@mac.com> Add stricter GlobalDecl constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
d0e3daf2b980b505e535d35b432c938c6d0208ef 05-Sep-2009 Douglas Gregor <dgregor@apple.com> Improve the AST representation and semantic analysis for extern
templates. We now distinguish between an explicit instantiation
declaration and an explicit instantiation definition, and know not to
instantiate explicit instantiation declarations. Unfortunately, there
is some remaining confusion w.r.t. instantiation of out-of-line member
function definitions that causes trouble here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4fe95f99a2693f1145785ea5835ba6937e49c730 04-Sep-2009 Douglas Gregor <dgregor@apple.com> Don't generate any code for an explicit call to a trivial destructor.

Now that parsing, semantic analysis, and (I think) code generation of
pseudo-destructor expressions and explicit destructor calls works,
update the example-dynarray.cpp test to destroy the objects it
allocates and update the test to actually compile + link.
The code seems correct, but the Clang-compiled version dies with a
malloc error. Time to debug!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dd9967a6374c9a44be4af02aaeee340ffb82848f 03-Sep-2009 Douglas Gregor <dgregor@apple.com> Don't try to CodeGen using directives, from Anders Johnsen

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
293361afd4199c92aabff9267fddea890943c586 25-Aug-2009 Anders Carlsson <andersca@mac.com> Emit conversion functions correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b193a414f13d7cfa2524a8149eff8d4871f8cbf6 16-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch toward synthesizing non-trivial destructors. WIP


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5add6835b0c6b0f67e19fd5366825d3e41eb0dcf 16-Aug-2009 Anders Carlsson <andersca@mac.com> No need to append extra padding now that we don't create packed structs for simple cases like the constant string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
183d7181fd59842ac969cbc6fe0376f85dc63ae4 14-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug in ir-gen for copy assignment synthesis.
Fixed a bug when evaluating those copy-assignments
which need by lazily syntheized. A test case
for these.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
ad25883a644dd6b52c7923dd128a7d05fb26213c 13-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to force synthesis of copy assignment operator
function in the order according to c++03. ir-gen
for copy assignment in the trivial case and the first
test case.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e64941280877d065a27e8cefd2a9038256d0e3ac 11-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen support for anonymous union data member
copying in copy constructors and used in
default constructor's initializer list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8c64e007d9b2f719613f7d79b0b32d2f50da9332 11-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Support for anonymous union in ctor's initializer and
bunch of FIXMEs for their is-gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
80e4b9e0e87064a824d72b6ff89074206ecced58 08-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Remove use of uninitized variable.



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



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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e78b86f3201ae5f09e2cf85bd6558f1d9b34de26 05-Aug-2009 Chris Lattner <sabre@nondot.org> weak globals that are const should get weak_odr linkage.

add a fixme about C++ const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
309457d0f1b416c1b379c9f3e172848adffedb23 05-Aug-2009 Chris Lattner <sabre@nondot.org> rdar://7119244 - globals with an explicit section specified don't get
common linkage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
434da48d0e35764f18b3fc96c75504746050b046 03-Aug-2009 Daniel Dunbar <daniel@zuster.org> Make sure UTF-16 strings end with a 16-bit null (as opposed to 8-bit).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c43f2f4340cd8b6bbf0cbc955d613c5a96388b85 02-Aug-2009 Anders Carlsson <andersca@mac.com> Whoops, meant to delete this.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f976be8a63f9e0d3bd50e33dadef02c3c9921747 01-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Don't error on C++ linkage; if we don't support that, there are
serious issues :)



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


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


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


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

And remove Type::getAsReferenceType(), etc.

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


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


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


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
70ee975fad4653fa09f8e77f9a46a7b1f592ef59 24-Jul-2009 Daniel Dunbar <daniel@zuster.org> Output UTF-16 string literals independent of host byte order.
- Steve, can you take a look at this? It seems like this code should live
elsewhere, and there is a FIXME about having Sema validates the UTF-8 to
UTF-16 conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1d5529132e4620562cab931c1f84c24e42f02741 24-Jul-2009 Daniel Dunbar <daniel@zuster.org> Factor out map lookup for CFString constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ec586e7b10394aeed25c8e5ee02d230951826136 23-Jul-2009 Daniel Dunbar <daniel@zuster.org> Simplify, NFC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2a3856ac8a52ed84349e830253c5dac616858f5c 23-Jul-2009 Daniel Dunbar <daniel@zuster.org> Simplify.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ad64e024bd18cf25dcfa44e049004371838decd8 18-Jul-2009 Chris Lattner <sabre@nondot.org> fix objc codegen to not have its own list of things that eventually get into llvm.used, just
populate CGM's list directly.



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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9d4a15fd3b85434c43ea27562793de63a793321a 16-Jul-2009 Chris Lattner <sabre@nondot.org> use CreateRuntimeVariable to get __CFConstantStringClassReference
instead of doing it manually (which might end up getting auto-renamed),
fixing a FIXME. rdar://7065446


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
95b851e55c328af4b69da7bfc1124bf258c0ffe5 16-Jul-2009 Chris Lattner <sabre@nondot.org> codegen string literals using private linkage now like llvm-gcc, eliminating
some target hooks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
6dba432c7b862c2219e5d6e52b0cd188fbf84b01 14-Jul-2009 Devang Patel <dpatel@apple.com> Revert 75648 for now. It is causing test failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
61b5f3e12c0ab5dd2e8b98bb827855420bb9869b 14-Jul-2009 Devang Patel <dpatel@apple.com> Use LLVM mangler to get mangled name for debug info entry.



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


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


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


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

Timings showed no significant difference before and after the commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
1fd2dd145d9bcdf0b8d60a88e1795b6ae83656f5 30-Jun-2009 Douglas Gregor <dgregor@apple.com> Improve code generation for function template specializations:
- Track implicit instantiations vs. the not-yet-supported explicit
specializations
- Give implicit instantiations of function templates (and member
functions of class templates) linkonce_odr linkage.
- Improve name mangling for function template specializations,
including the template arguments of the instantiation and the return
type of the function.

Note that our name-mangling is improved, but not correct: we still
don't mangle substitutions, although the manglings we produce can be
demangled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
127102b5196ffe04bdb70fd553fe62c265ab10a9 29-Jun-2009 Douglas Gregor <dgregor@apple.com> Keep track of function template specializations, to eliminate
redundant, implicit instantiations of function templates and provide a
place where we can hang function template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
16e8be2ac532358d4e413fdfa2643b1876edda78 29-Jun-2009 Douglas Gregor <dgregor@apple.com> Move FunctionDecl::TemplateSpecializationInfo out into its own class,
FunctionTemplateSpecializationInfo, in DeclTemplate.h. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c38e9affd4519ea199af22419c8c794973cc4b23 23-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Patch fixes an obscure bug when 'used' attribute is applied to
variables in ObjC's Next runtime mode. Next runtime also implicitly applies
'used' attribute on some of its meta-data. This results in two
'llvm.used' arrays to be generated, and one of them is renamed to
'llvm.used1'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9cfbe48a7a20a217fdb2920b29b67ae7941cb116 20-Jun-2009 Douglas Gregor <dgregor@apple.com> Parsing and AST support for using declarations, from John Thompson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
f5cecfbdcd20be224861f9e67c5973a9a2b61512 18-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
86df27bbdbb98c39ec2184695c0561209f91bedd 14-Jun-2009 Chris Lattner <sabre@nondot.org> move GetBuiltinType from Builtin::Context to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
36674d2978eb53962218ac67bb4d352cc287ea05 11-Jun-2009 Anders Carlsson <andersca@mac.com> Don't assert when generating code with static_asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2968b7741da535810250b919c95d12105882d19f 06-Jun-2009 Daniel Dunbar <daniel@zuster.org> weak_import should not make definitions have weak linkage.
- <rdar://problem/6948703> clang treats weak_import like weak


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
08c93a7f2210b464e5abe298a5474b99414615f6 04-Jun-2009 Chris Lattner <sabre@nondot.org> Make ReplaceUsesOfNonProtoTypeWithRealFunction verify that a call is *to* the
function of interest, not an operand of it.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c6c14d1cd68afcd90d097715296377f15be45210 26-May-2009 Eli Friedman <eli.friedman@gmail.com> Handle the edge case of a weak function with incomplete type correctly.
Found by code inspection; I haven't seen this in real-world code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2928c2107f2e0007f35fe1c224aab63535f1403d 16-May-2009 Anders Carlsson <andersca@mac.com> extern "C" should preserve the 'extern' qualifier for VarDecls. Fixes 6853728.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
167b824ce1947bf71ec8a71296daa2c54ebe58df 15-May-2009 Anders Carlsson <andersca@mac.com> A C++ member function always has either weak linkage (if it's inline or defined inline) or strong linkage (other cases).

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0c337ed63ff0f04fd8315afabb2d7a51969fdc97 12-May-2009 Chris Lattner <sabre@nondot.org> add an initial stab at emitting deferred c++ inline functions. This handles static
functions and methods declared inline, but not ctors/dtors or methods not declared
inline (apparently my previous patch wasn't good enough).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9fa959d5bfbbb17d7c6ba71252219201fc8dc971 12-May-2009 Chris Lattner <sabre@nondot.org> cleanups, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71590 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
005eedce54da6580de37bb115bf581008637e4b1 12-May-2009 Chris Lattner <sabre@nondot.org> revert my previous patch, I committed the wrong file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
43ac9654d088a0e27599e5fa3df532d6de142f5e 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@71583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bdb0132722082886558f31eccdba06ae1852c0ee 05-May-2009 Chris Lattner <sabre@nondot.org> When defining a function whose type has no prototype, make an effort
to go back and clean up existing uses of the bitcasted function. This
is not just an optimization: it is required for correctness to get
always inline functions to work, see testcases in function-attributes.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2a131fbca2a51085dc083b8c56a2d4ced3cf1413 05-May-2009 Anders Carlsson <andersca@mac.com> Refactor global decls to hold either a regular Decl or a CXXConstructorDecl + ctor type or a CXXDestructorDecl + dtor type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
43907e87c776391d7d96da04b48e7bf06d8baafc 03-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix comment to account for r70786.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5e222139610a9f8b2b5f4ddd112f10dec9ec1e97 03-May-2009 Eli Friedman <eli.friedman@gmail.com> PR4133: fix always_inline implementation to be consistent with gcc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9f9bf258f8ebae30bfb70feb9d797d6eb67b0460 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Improve compatibility with GCC regarding inline semantics in GNU89
mode and in the presence of __gnu_inline__ attributes. This should fix
both PR3989 and PR4069.

As part of this, we now keep track of all of the attributes attached
to each declaration even after we've performed declaration
merging. This fixes PR3264.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b3efa98e320590e8be9d62818e89e599303e65b4 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Fix handling of C99 "extern inline" semantics when dealing with
multiple declarations of the function. Should fix PR3989 and
<rdar://problem/6818429>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
653f1b1bf293a9bd96fd4dd6372e779cc7af1597 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate the three SmallVectors in ObjCImplDecl (for instance
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.

This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
412f59b23fc502b199b9ca96c72ef5d5ad21d62b 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Don't convert interface types (to structs) as part of CodeGenTypes.
- This has pros and cons, but for now the pros seem to significantly
outway the con.

The con is that we will always need to cast in the runtime
implementation to a struct type, if we wish to access an interface
directly.

The pros are:
- Avoid the cost of generating types which are used. Most
manipulation of Objective-C objects is done through messages, and
only the implementation of a class will directly access
memory. Previously, we would convert the type even if it only
appear as a function parameter, for example.

- We don't need to worry about incomplete types, and
UpdateCompletedType for interfaces is gone.

- It becomes easier to narrow the interface to the shadow struct for
Objective-C interfaces (so it can be eliminated).

Currently the runtimes still use the CodeGenTypes machinery to
generate the LLVM structure they need via ConvertTagDecl, but this can
eventually be replaced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d55a71d852d4d8b785122b8d033a0c06b187067b 22-Apr-2009 Chris Lattner <sabre@nondot.org> Fix some mishandling of the attr(gnu_inline) mode when used with
extern. Previously we would warn about it and ignore the attribute.
This is incorrect, it should be handled as a c89 "extern inline"
function. Many thanks to Matthieu Castet for pointing this out and
beating me over the head until I got it.

PR3988: extern inline function are not externally visible




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7520bd1de12af10ea08c662440565adbdf589317 21-Apr-2009 Douglas Gregor <dgregor@apple.com> Fix emission of static tentative definitions referenced from other static functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b6c8c8bd8d362c8a6cdb767415b0d21e62b77eb2 21-Apr-2009 Douglas Gregor <dgregor@apple.com> Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the
translation unit.

Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.

Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
cf2a7211b4785068c7efa836baab90b198a4d2a6 20-Apr-2009 Chris Lattner <sabre@nondot.org> the __gnuc_inline__ attribute is actually named __gnu_inline__,
PR4023


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
56ebe5082da7411fb37479e230b52735f77cff35 19-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR3853: Add CodeGen support for __thread.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69545 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
271474e32f38cc5bd735c1006e499996cbc6e2d1 19-Apr-2009 Chris Lattner <sabre@nondot.org> silence a warning, it isn't clear what the right answer is here,
will talk to steve.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
27ae53665f8b00fe4ba21da0fa79a4ce6e0b6cd5 17-Apr-2009 Anders Carlsson <andersca@mac.com> Add support for generating (very basic) C++ destructors. These aren't called by anything yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69343 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0e4f40e1bbc4dce16bbb9870300a435419f1b3d5 17-Apr-2009 Daniel Dunbar <daniel@zuster.org> Attributes on block functions were not being set.
- <rdar://problem/6800351> clang not producing correct large struct
return code for Blocks


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6463ef4caf2fb576d38b1b2e15a29ac9f2abb3e7 16-Apr-2009 Daniel Dunbar <daniel@zuster.org> Ensure that the most recent declaration of a tentative definition wins
when generating a common definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
03f5ad9a7707e098f601921fcec17ed65eb355a7 16-Apr-2009 Daniel Dunbar <daniel@zuster.org> Defer generation of tentative definitions.
- PR3980.

- <rdar://problem/6762287> [irgen] crash when generating tentative
definition of incomplete structure

- This also avoids creating common definitions for things which are
later overwritten.

- XFAIL'ed external-defs.c, it isn't completing types properly yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
95d4e5d2f87a0f07fb143ccb824dfc4c5c595c78 15-Apr-2009 Anders Carlsson <andersca@mac.com> Start attempting to generate code for C++ ctors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
57d5cee133495bc21d1abdbce45ab05a79274a23 15-Apr-2009 Daniel Dunbar <daniel@zuster.org> Comment fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
cbb8fc18d86a886856f5b852a6a3ead71fec17f9 14-Apr-2009 Chris Lattner <sabre@nondot.org> Fix PR3988: extern inline functions get strong symbol definitions in
C99 mode. This is a regression from an earlier patch of mine.

This also simplifies the linkage enums a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
86daeee2d4aa6523679f07f27a826bf4c42ca95d 14-Apr-2009 Chris Lattner <sabre@nondot.org> implement codegen support for __attribute((__gnuc_inline__)),
pulling some attribute munging stuff into GetLinkageForFunction.

This should fix PR3986


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7c65e990e9f0dafaf9adbc59b766dcc23eaee845 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Refactor how attributes are set on values.
- Pull out SetCommonAttributes, which handles the things common to
aliases, methods, functions, and variables.

- Pull out SetLLVMFunctionAttributesForDefinition, which handles the
LLVM attributes which we only want to apply to a definition (like
noinline and alwaysinline).

- Kill SetGVDeclarationAttributes (inlined into SetFunctionAttributes
and specialized).

- Kill SetFunctionAttributesForDefinition (inlined into sole caller).

- Inline SetGVDefinitionAttributes into SetMethodAttributes and
specialize.

- Rename SetGVDefinitionAttributes to SetFunctionDefinitionAttributes.

This is supposed to be a no functionality change commit, but I may
have made a mistake.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
55d6f50b23a1fd0a04b568787a25beb7537e6c9b 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Split SetGlobalValueAttributes into definition/declaration halves.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7dbd8197040313d796282d4af06eccdf8a17319c 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Rename (one) SetFunctionAttributes to SetLLVMFunctionAttributes to
disambiguate it.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
529d7d2c6ed88930bc3d7aab7611a50b6169e279 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Reduce indentation, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dbb5a376c8b9272813a30c5519031e9ea2fb071f 14-Apr-2009 Chris Lattner <sabre@nondot.org> defer emission of always_inline, extern_inline, and inline functions (when
not in c89 mode).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d5ee6677c5f22409039a019accf41ec3937afe99 14-Apr-2009 Chris Lattner <sabre@nondot.org> give always_inline functions internal linkage. If they cannot be
inlined for some reason, then we don't want a strong or even weak
definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d9d049a93c55624908e81cf3927b7905efeba05f 14-Apr-2009 Chris Lattner <sabre@nondot.org> set the linkage of an inline function according to its language rules.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b97b69244a4e7916c7b8fca28fa21b36ce5b30b2 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add a comment on SetGlobalValueAttributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
44b0bc008ee11cdee69ad12210ca7550e4fa426a 14-Apr-2009 Chris Lattner <sabre@nondot.org> add a new enum type for linkage, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
04d4078425614bf9fd58d606335c1f5f74ee7fa4 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Clean up handling of visibility.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9f9427999cf69b3b89cd0ed3be16ed27a1c282c7 14-Apr-2009 Chris Lattner <sabre@nondot.org> reduce indentation, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
df102fcb978588d5edbc661fb5da0b6922f9ab1c 14-Apr-2009 Chris Lattner <sabre@nondot.org> do not set visibility on "private" or "available externally" linkage objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
fd942628abfe30e30427875db953222ae99b4325 13-Apr-2009 Steve Naroff <snaroff@apple.com> Move/update recent FIXME (wrt UTF-8 checking for ObjC @-strings).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
aa4a756185e77755aaa10ae50db08ae5be58e70a 13-Apr-2009 Steve Naroff <snaroff@apple.com> Fixed crasher in <rdar://problem/6780904> [irgen] Assertion failed: (Result == conversionOK && "UTF-8 to UTF-16 conversion failed"), function GetAddrOfConstantCFString, file CodeGenModule.cpp, line 1063.

Still a diagnostic related FIXME (will discuss with Daniel/Fariborz offline).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7e714cd931fa3a90bfd728318a92485aa3e95748 10-Apr-2009 Daniel Dunbar <daniel@zuster.org> Internal variables could mistakenly have "hidden" visibility when
their emission was deferred.
- <rdar://problem/6775234> variables with internal linkage should not
be exposed with -fvisibility=hidden.


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


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
03abc9ec05e8edce5e8d0c7f08a05027b9e04170 08-Apr-2009 Daniel Dunbar <daniel@zuster.org> Visibility attributes should only be set on definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6ab187a49a42de6d351248d8a6e0206e39743a0c 07-Apr-2009 Daniel Dunbar <daniel@zuster.org> Various fixes to symbols used for Obj-C x86_64 metadata.
- Changed method names to match gcc (categories names still aren't
mangled in).

- Expose correct name for class and metadata symbols (although
-fvisibility=hidden isn't yet correct).

- Remove several things from llvm.used that didn't need to be there
(I suspect this can still be trimmed).

- Don't use asm-prefix extension for _objc_empty_{cache,vtable} (not
needed).

- Hide EH type class info with -fvisibility=hidden

- Change setGlobal[Option]Visibility to not change the visibility of
functions with internal linkage.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
db6d4f65f9f0a4b6e9b4b6ead9968c2e372e9642 03-Apr-2009 Steve Naroff <snaroff@apple.com> Add a comment/FIXME so Eli can sleep better:-))


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7cd2e93125e2f3b6ca01b24ed0c3fd7e94683fd9 03-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Implement -fvisibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a9668e0b4c451a1021fe650c451b54dc98c2d18d 03-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add target hook for setting symbol prefix and section of unicode
string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
91e20dd8bf1bc8980ee93839383d2bd170bce050 02-Apr-2009 Anders Carlsson <andersca@mac.com> Emit code for linkage specifications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b59212a6e494d2c364b54462f545833902c29158 01-Apr-2009 Steve Naroff <snaroff@apple.com> CodeGenModule::GetAddrOfConstantCFString():
- Finish up support for converting UTF8->UTF16 to support ObjC @"string" constants.

Remove warning from CheckObjCString.

As the FIXME in the test case indicates, I still have a bug to work out (apparently with \u handling).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e9b7d8ace8674585818990cff585daae7745bd88 01-Apr-2009 Steve Naroff <snaroff@apple.com> Add ConvertUTF module from http://www.unicode.org/Public/PROGRAMS/CVTUTF.

#ifdef'd out the 5 conversion routines that we don't currently need.

Still need a bit more work in GetAddrOfConstantCFString(). Added a FIXME to indicate this.

Expect to remove the FIXME today...


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

Patch by Jean-Daniel Dupas. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
285d0dba947b7c9960eaa88e8c4fced0398d4319 01-Apr-2009 Chris Lattner <sabre@nondot.org> fix the two xfails I added with a previous patch by making ObjC interface
types get completed when their definition is seen if previously laid out by
the code generator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5ad0f6778556535dca448e9d82e674d2d255ad06 01-Apr-2009 Chris Lattner <sabre@nondot.org> move trivial forwarding function inline.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
984e06874685396ca2cb51f0008cfff7c9b3d9c6 01-Apr-2009 Anders Carlsson <andersca@mac.com> Implement code generation of namespaces and add mangling tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8e5c2b8072f4409c7c0004331d1db9652d5209c0 01-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add Target hooks for IRgen of [cf]string literals.
- Notably, set section on cfstring literal string data (for now, this
is done everywhere because it matches what we were already doing
for the CFString data itself)

- <rdar://problem/6599098> [irgen] linker requires objc string data
to go into cstring


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
35f38a2c22d68c22e2dbe8e9ee84c120c8f327bb 01-Apr-2009 Chris Lattner <sabre@nondot.org> Change UsedArray to be a vector of WeakVH to fix a dangling pointer problem that occurs when
attribute(used) and asm renaming are used together.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
55d3aaf9a537888734762170823daf750ea9036d 27-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Finish off semantic analysis for regparm, and remove the warning. Also
remove a redundant error in CodeGen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ee760330a415635369556796a97afcfd6207f4dc 27-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Besides the warning, issue unsupported diagnostics in
ir gen. No intended change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bd3606426d389370616126af969904ec493cb105 26-Mar-2009 Chris Lattner <sabre@nondot.org> most of this is plumbing to get CompileOptions down into
CodeGenModule. Once there, add a new NoCommon option to
it and implement -fno-common.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b808c952bbff821dce727dd801a1098d64394f98 22-Mar-2009 Chris Lattner <sabre@nondot.org> switch getBuiltinLibFunction to use the new GetOrCreateLLVMFunction
functionality, fixing a crash on the attached testcase. Eliminate the
BuiltinFunctions cache, as it can contain dangling pointers. This fixes
a bunch of valgrind errors on test/CodeGen/builtins.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
bd53271dc7570b54f7b7cab7b09bcf04c6e927f6 22-Mar-2009 Chris Lattner <sabre@nondot.org> emit aliases as the definitions fly by, don't bother deferring until
the end of the module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
35f6c136dd5201b87831dcdacc1eb4d2c2de0744 22-Mar-2009 Chris Lattner <sabre@nondot.org> make alias definition logic more similar to functions/globals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
82227ff4eb665bbf41720ebdc0dc9215a86ba838 22-Mar-2009 Chris Lattner <sabre@nondot.org> fix PR3200 by making alias emission use the new infrastructure. Fold
some tests into the alias.c file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
74391b48b4791cded373683a3baf67314f358d50 22-Mar-2009 Chris Lattner <sabre@nondot.org> pull "runtime globals" into the same framework as other functions/global variables.
No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ff75e1db95a53c7606e0bb114cf9adc59ab3d7f6 22-Mar-2009 Chris Lattner <sabre@nondot.org> fix a fixme: non-proto struct returning function definitions should be compiled
to something like:
define void @bar(%struct.foo* noalias sret %agg.result) nounwind {
instead of:
define void @bar(%struct.foo* noalias sret %agg.result, ...) nounwind {



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d972678a053d4785772b75cf6c8d4ab74ac2c7f6 22-Mar-2009 Chris Lattner <sabre@nondot.org> set function/global names with setName instead of passing the name into the
ctor function. This avoids creating a temporary std::string for the name,
speeding up the testcase in PR3810 by 3.8%


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b31cb7f1752ea011fd06ac9574ce24667d11cbdb 21-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Issue error if variables are defined inside an objc class,
category or protocol.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
67b00520c8f5b48fad722b790d87fea6be764efe 21-Mar-2009 Chris Lattner <sabre@nondot.org> now that all the decl reference and creation stuff is going through two
very simple places, reimplement the deferred decl emission logic to not be O(N^2),
fixing PR3810.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0558e79840bfdbbd38c6e2b4f6765bf0158e85f4 21-Mar-2009 Chris Lattner <sabre@nondot.org> fix a crash that could occur when a variable declaration became a
function definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
570585c91dee98d7ba8ccf1198c03208ba17966b 21-Mar-2009 Chris Lattner <sabre@nondot.org> simplify and cleanup global variable creation stuff to all go through one
code path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
34809507232bc4c3c4840c7d092c7440219fddaf 21-Mar-2009 Chris Lattner <sabre@nondot.org> simplify management of llvm::Function creation to all go through
GetAddrOfFunction. This is simpler and more efficient.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67444 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
62b33ea51adbd0e7f2f05983e9e4a3a2b2ed26de 21-Mar-2009 Chris Lattner <sabre@nondot.org> code cleanups, rename EmitForwardFunctionDefinition ->
CreateFunctionPrototypeIR, though my next patch will eliminate
it entirely.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ca3f25c1fb9bbf0d807985baee460670b7f195b4 21-Mar-2009 Chris Lattner <sabre@nondot.org> fix several problems with asm renaming, by pulling it into the mangling code:

1. it wasn't applying to definitions, only declarations, e.g. int x __asm("foo")
2. multiple definitions were conflicting, they weren't getting merged.
3. the code was duplicated in several places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2d58406872e5af0c924623d9f7c194c4f09936d3 21-Mar-2009 Chris Lattner <sabre@nondot.org> add some fixmes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5d4f5c724533b994de05df49ae259120482ec366 21-Mar-2009 Chris Lattner <sabre@nondot.org> reduce redundant calls of getMangledName.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
99b53613ebe2c59d41030e987962c1ed101b2efe 21-Mar-2009 Chris Lattner <sabre@nondot.org> simplify some more code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e21c4b829c9e69c20f4baab4916e05cdb786d9ae 21-Mar-2009 Chris Lattner <sabre@nondot.org> simplify and comment some code better. Make BindRuntimeGlobals
more optimistic that it will work (optimizing for the common case).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3c8f153ae767fa55b2da74438c7f8ec370a06d6f 21-Mar-2009 Chris Lattner <sabre@nondot.org> random code cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5b60a0e369521825f892d755150255645d923646 21-Mar-2009 Chris Lattner <sabre@nondot.org> remove obviously dead code: you can't bitcast a pointer to "Ty" (a function type).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8f431a554367d2828b82612b456c3a2ce737e799 21-Mar-2009 Chris Lattner <sabre@nondot.org> avoid making constant folding logic eliminate obviously dead bitcasts, speeding up PR3810
by ~2%.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c50689bd1e8788a7fc8f19070b7505ff95034979 21-Mar-2009 Chris Lattner <sabre@nondot.org> Add a fast path to CodeGenModule::getMangledName for almost all C functions,
speeding up the testcase in PR3810 by 60%.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5e1e1f95c98b1add70c238093bbd5dc8d4f9c4e9 19-Mar-2009 Daniel Dunbar <daniel@zuster.org> IRgen support for alias of global variable.
- PR3818.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
38e24c782c17b6058bf61d635747bbde19fb1bc7 18-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> objc: Implemented variables declared in class interface
whose sema decl is at the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ceb77d909f80d4949ee6177094510413c391cddc 11-Mar-2009 Duncan Sands <baldrick@free.fr> Adjust for linkage name change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e3fedbeee8a014cd4f4e7cad8e7f6059eae12410 11-Mar-2009 Duncan Sands <baldrick@free.fr> Correct for change of this name in LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
42745815fa4e90bfb07e581d2e5152b2c2db08ff 10-Mar-2009 Daniel Dunbar <daniel@zuster.org> Backout r66408, we don't want handling of globals to rely on the
module symbol table. The root problem inspiring this was fixed in
r66316 (and again in r66506).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
53d89225560fb9434a68e25019a31a75c0006537 09-Mar-2009 Mike Stump <mrs@apple.com> Be sure to never create two functions with the same name, instead arrange to
reuse the prior one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a210f350fa78c263caa26e0f999cce85bb235309 07-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Make constant emission for @encode use the common string emission code.
This is a bit cleaner, and also "fixes" bad code that compares the
addresses of the string constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
286acbdbe0c82e9a6bcad5fca3c4fa582f3f1a2c 07-Mar-2009 Mike Stump <mrs@apple.com> Fixup our uses of various linkages to match how llvm now works. I think they are all
correct, but an extra set of ObjC eyes would be good.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b681b8ffab2aa016b3897916d5110927c34a584b 06-Mar-2009 Daniel Dunbar <daniel@zuster.org> (LLVM svn up) Generalize RuntimeFunctions to RuntimeGlobals and add
CodeGenModule::CreateRuntimeVariable.

- No real functionality change; although we now assert on silly
things like:
--
int objc_exception_throw;
void f0() { @throw(@"A"); }
--
instead of accepting it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5e27314eb5a9cba7997cf9f6fc82428d99667077 06-Mar-2009 Daniel Dunbar <daniel@zuster.org> IRgen support for weak_import.
- <rdar://problem/6652110> clang should support weak_import


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
fe345572459b69a6b680322fef504b4f8bd98dd7 05-Mar-2009 Daniel Dunbar <daniel@zuster.org> Don't mangle names of local variables.
- For one thing, this adds unneeded overhead; for another, this
routine can be used to emit unnamed decls which we shouldn't try to
mangle.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2136b2e9345c23c26426110873dd97ef5d761ef2 05-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Make IRGen compatible with declaring a function with incomplete
return/argument types. (The generated IR isn't ideal, but we can't
really do better in general.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
90a904309c79977fcba2ff0542e2e4cd8e3c3faf 04-Mar-2009 Mike Stump <mrs@apple.com> Move more of the blocks code up and out.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3f75c43bd77e063342bc888ac276daf64ba0ce07 04-Mar-2009 Daniel Dunbar <daniel@zuster.org> Support "asm" renaming of external symbols.
- PR3698.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
74ac74ae244c501027924c99f2a33559a1e23b53 02-Mar-2009 Daniel Dunbar <daniel@zuster.org> Don't set nounwind on functions when in using the new Obj-C ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4667c4a309f7d49f858e14c4c2462fe595bcc536 01-Mar-2009 Chris Lattner <sabre@nondot.org> simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
22c818aa988b7e0750716ca869e8757586da65b6 01-Mar-2009 Anders Carlsson <andersca@mac.com> Initialize NSConcreteStackBlock

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c136e6cf237711f9f1324637a0b2cdf6ae8e79e4 27-Feb-2009 Mike Stump <mrs@apple.com> Fix PR3612. We ensure that we add builtins to the GlobalDeclMap and
we ensure that things added to the module can be found even when they
are not in GlobalDeclMap. The later is for increased flexibility,
should someone want to do something tricky like extern "Ada" in the
same module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0de40af3a3aa14e3854c0eafeabd08f6762801f9 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Minor cleanup: use getDeclAlignInBytes helper.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dbb1ecc32ca122b07b7c98fd0a8f6f53985adacc 27-Feb-2009 Chris Lattner <sabre@nondot.org> fix some sema problems with wide strings and hook up basic codegen for them.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
eda9a5ec380f172f4e0063744eb796144a125480 21-Feb-2009 Daniel Dunbar <daniel@zuster.org> Emit extern_weak when needed.
- PR3629.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6e656f45ae04b415ba7a4c0c25e55633e2d0ecd0 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Initialize the Init variable to something reasonable when we emit an
error, so we don't crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
81ebbde0fb30a40df0f5e913d8a1f71c383d271a 19-Feb-2009 Anders Carlsson <andersca@mac.com> Add irgen support for the noinline attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d5d31801fc87239436fa349c89dce7797cf13537 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Don't emit K&R unprototyped function definitions as varargs.
- <rdar://problem/6584606> clang/x86-64 - too many reg saves


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
232350d4faf46ec38d5ff60e11505f9c4fa9535b 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Emission of global variable initialializer was broken in rare
situation where a tentative decl was emitted *after* the actual
initialization. This occurs in some rare situations with static decls.
- PR3613.

- I'm not particularly happy with this fix, but I don't see a simpler
or more elegant solution yet.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b5da3e94b72a0106abd69c2a84bf650e773fa4ac 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add anti-FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6aee306b1c653bc7d86ae6cb2b905e8b8d0ac27f 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> Simplify.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
370ab3f1373841d70582feac9e35c3c6b3489f63 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Make it possible for builtins to expression FILE* arguments, so that
we can define builtins such as fprintf, vfprintf, and
__builtin___fprintf_chk. Give a nice error message when we need to
implicitly declare a function like fprintf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3e41d60eb627dc227c770f1c1c87d06909cf05fd 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Implicitly declare certain C library functions (malloc, strcpy, memmove,
etc.) when we perform name lookup on them. This ensures that we
produce the correct signature for these functions, which has two
practical impacts:

1) When we're supporting the "implicit function declaration" feature
of C99, these functions will be implicitly declared with the right
signature rather than as a function returning "int" with no
prototype. See PR3541 for the reason why this is important (hint:
GCC always predeclares these functions).

2) If users attempt to redeclare one of these library functions with
an incompatible signature, we produce a hard error.

This patch does a little bit of work to give reasonable error
messages. For example, when we hit case #1 we complain that we're
implicitly declaring this function with a specific signature, and then
we give a note that asks the user to include the appropriate header
(e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
case #2, we show the type of the implicit builtin that was incorrectly
declared, so the user can see the problem. We could do better here:
for example, when displaying this latter error message we say
something like:

'strcpy' was implicitly declared here with type 'char *(char *, char
const *)'

but we should really print out a fake code line showing the
declaration, like this:

'strcpy' was implicitly declared here as:

char *strcpy(char *, char const *)

This would also be good for printing built-in candidates with C++
operator overloading.

The set of C library functions supported by this patch includes all
functions from the C99 specification's <stdlib.h> and <string.h> that
(a) are predefined by GCC and (b) have signatures that could cause
codegen issues if they are treated as functions with no prototype
returning and int. Future work could extend this set of functions to
other C library functions that we know about.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7542bca16b63c84e401b44b586ac3378aed446c5 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> Simplify predicate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5c61d97ad442b2c0bbecb617c8f21857ce1fff6d 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> IRgen support for attribute used.
- PR3566


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
73241dfeb5c498255b662984cca369fd28ec3147 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> Pull MayDeferGeneration out of EmitGlobal.
- Fix emission of static functions with constructor attribute while I
was here.
<rdar://problem/6140899> [codegen] "static" and attribute-constructor interact poorly


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0269871c9cba493f76237175ab60313406f3bafa 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> Rename EmitStatics (etc) to EmitDeferred; provide basic infrastructure
for attribute used support.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7d6dc4ff45917c480d8b3350385337f34511ebaf 13-Feb-2009 Mike Stump <mrs@apple.com> Let the backend unique these.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
324699105567f2948db316c3a3dc4c1d38a3657e 13-Feb-2009 Mike Stump <mrs@apple.com> Move DescriptorUniqueCount into CGM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
26efc3388adb010984da2f70e1f24e8286e6476d 13-Feb-2009 Mike Stump <mrs@apple.com> Move GlobalUniqueCount up into CGM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64473 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9b8a7977109604d573b49d517e98badbbb9d5ac7 13-Feb-2009 Mike Stump <mrs@apple.com> Move GenericBlockLiteralType into CGM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ab695143861b520f5c9f8f982534a71d355396f1 13-Feb-2009 Mike Stump <mrs@apple.com> Move BlockDescriptorType into CGM.


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

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



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
17f194f4393a67fd28ad822c06d32b8cb99bad3f 12-Feb-2009 Daniel Dunbar <daniel@zuster.org> Support __attribute__(section(<name>))


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
56b8001b42bd603ef593e3cb278d8b9b9ba26ca9 06-Feb-2009 Daniel Dunbar <daniel@zuster.org> Use 'compile' instead of 'codegen' when reporting error to user.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d604c40e933c445ff33ac83d62cc6b1adcf7014c 04-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add -femit-all-decls codegen option.
- Emits all declarations, even unused (static) ones.
- Useful when doing minimization of codegen problems (otherwise
problems localized to a static function aren't minimized well).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.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/CodeGenModule.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/CodeGenModule.cpp
30bc57187be7535c57ef1ca8ff3e765653e94332 23-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Use NonFragileABI as name of new Next abi. More comments
for the new meta-data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ee0af74d1e0990c7b66d32657f3e4e54b8691552 21-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Refactoring ObjC Next's runtime classes in preparation for
the new ObjC's abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f7cf85b330bedd2877e1371fb0a83e99751ae162 16-Jan-2009 Chris Lattner <sabre@nondot.org> more SourceLocation lexicon change: instead of referring to the
"logical" location, refer to the "instantiation" location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
49988884c1da4b2200bfe2298a1e41b3f044e8d4 13-Jan-2009 Daniel Dunbar <daniel@zuster.org> Bug fix, __private_extern__ globals were always introducing a definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
305c658ebce84bb9833fc0e7675554656453b8e8 08-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Objc's compatibility-alias semantics and code
gen issue fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3ef5db646a6f66bb23146c3e506c294f31adf018 05-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Silence a GCC warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b723f7520bcce5f13ccaae557c16a1e7133b6908 04-Jan-2009 Anders Carlsson <andersca@mac.com> Fix the bug that would cause Python to crash at startup.

When emitting the static variables we need to make sure that the order is preserved.
Fix this by making StaticDecls a std::list which has O(1) random removal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2f402708e62f89fb875442802e3d3f20fc909d33 26-Dec-2008 Anton Korobeynikov <asl@math.spbu.ru> Add full dllimport / dllexport support: both sema checks and codegen.
Patch by Ilya Okonsky

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

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

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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
fef30b55230064d334a669a065a1c9acdb87cdfe 09-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Support for implementation of property in the case where
the synthesis is in an implementation of s subclass of
a super class where the property has been declared.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c9f29c61856ffb5f643cedbe87ac076f21a1381a 09-Dec-2008 Chris Lattner <sabre@nondot.org> Fix a serious null termination bug found by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
98883e1e699457697fb8d5ac6d175dd3ee078774 03-Dec-2008 Anders Carlsson <andersca@mac.com> If a global var decl has an initializer, make sure to always set its linkage to external.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d9d22dd9c94618490dbffb0e2caf222530ca39d3 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName(). This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4e8a9e8640a6717120394ee2ee5f27989757754d 21-Nov-2008 Chris Lattner <sabre@nondot.org> reapply the (corrected) patch to use the new llvm intrinsics for memcpy/memmove etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d67777662b7aac5a007513ba1fe25cb60e13fc3d 21-Nov-2008 Chris Lattner <sabre@nondot.org> temporarily revert Sangiv's patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8d668a467ab782bd57c54a639a03f2e74382af84 21-Nov-2008 Sanjiv Gupta <sanjiv.gupta@microchip.com> mem[cpy,set,move] intrinsics are now overloaded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8fbc1540966901a0b2b033c92f4c4257c08621f8 19-Nov-2008 Sanjiv Gupta <sanjiv.gupta@microchip.com> Pointer width for PIC16 is 16 bits. Modify getMemCpy, getMemMove and getMemSet accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0293d540baafbe070c1035611787a81001a4118e 19-Nov-2008 Daniel Dunbar <daniel@zuster.org> Discard unused runtime function declarations (for readability).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0a14eee528a901c16f0e288fbc10a3abc1660d87 18-Nov-2008 Chris Lattner <sabre@nondot.org> This reworks some of the Diagnostic interfaces a bit to change how diagnostics
are formed. In particular, a diagnostic with all its strings and ranges is now
packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a
ton of random stuff. This has the benefit of simplifying the interface, making
it more extensible, and allowing us to do more checking for things like access
past the end of the various arrays passed in.

In addition to introducing DiagnosticInfo, this also substantially changes how
Diagnostic::Report works. Instead of being passed in all of the info required
to issue a diagnostic, Report now takes only the required info (a location and
ID) and returns a fresh DiagnosticInfo *by value*. The caller is then free to
stuff strings and ranges into the DiagnosticInfo with the << operator. When
the dtor runs on the DiagnosticInfo object (which should happen at the end of
the statement), the diagnostic is actually emitted with all of the accumulated
information. This is a somewhat tricky dance, but it means that the
accumulated DiagnosticInfo is allowed to keep pointers to other expression
temporaries without those pointers getting invalidated.

This is just the minimal change to get this stuff working, but this will allow
us to eliminate the zillions of variant "Diag" methods scattered throughout
(e.g.) sema. For example, instead of calling:

Diag(BuiltinLoc, diag::err_overload_no_match, typeNames,
SourceRange(BuiltinLoc, RParenLoc));

We will soon be able to just do:

Diag(BuiltinLoc, diag::err_overload_no_match)
<< typeNames << SourceRange(BuiltinLoc, RParenLoc));

This scales better to support arbitrary types being passed in (not just
strings) in a type-safe way. Go operator overloading?!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
2383b7f6aea2cb2bf2b5bfc0ec730f9354fecbbf 18-Nov-2008 Chris Lattner <sabre@nondot.org> Change the diagnostics interface to take an array of pointers to
strings instead of array of strings. This reduces string copying
in some not-very-important cases, but paves the way for future
improvements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e3daa761061982f2267f7c8fb847ea02abad0aa9 15-Nov-2008 Anders Carlsson <andersca@mac.com> Handle padding in the constant CFString struct. Fixes PR3046.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f1c9c09e2e2220e4bbfb7e9d8adf9bf2c2406b80 11-Nov-2008 Anton Korobeynikov <asl@math.spbu.ru> Codegen support for fastcall & stdcall CC.
Patch by Ilya Okonsky!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
21ef7ae45c8b91f23cf5eab2263421bb398a644b 04-Nov-2008 Chris Lattner <sabre@nondot.org> LinkageSpecDecl is c++ specific, move it to DeclCXX


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
af668b0e7d3581dea3b4f29a9262686e83887e5b 28-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add attribute always_inline support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5fabf9dbee29464bcd06cd09f8e569d1b850f948 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add option argument to GetAddrOfConstantString to use for name of
(first) global holding the string.
- No functionality change.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f1968f28869f4e0675450ae39c478a37c5b9abd6 01-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add simple interface for protecting runtime functions from name
collisions.
- Provide CodeGenModule::CreateRuntimeFunction which guarantees that
the function it creates will have the provided name in the final
module. This allows the runtime to have its functions protected
from declarations of the same name in the source code.

- One could argue that this is a reason to abuse the llvm::Module
namespace for dealing with function redeclarations. However, that
approach seems conceptually flawed to me. This one also happens to
be somewhat more efficient.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f93349f3ec4d69eafba42436c33aaa91bfca7e70 27-Sep-2008 Daniel Dunbar <daniel@zuster.org> Prefer llvm::Function::addFnAttr(...) to F->addAttribute(~0, ...).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.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/CodeGenModule.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/CodeGenModule.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/CodeGenModule.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/CodeGenModule.cpp
219df6644e2338ff067471ab0d85f27b88544ac2 09-Sep-2008 Daniel Dunbar <daniel@zuster.org> Fix a number of issues w.r.t. emission of global for functions and
aliases.
- Attributes specific to a definition are only set when the
definition is seen.
- Alias generation is delayed until the end of the module; necessary
since the alias may reference forward.
- Fixes: PR2743, <rdr://6140807&6094512>
- Improves: <rdr://6095112> (added XFAIL)

Also, print module on verification failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.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/CodeGenModule.cpp
3a9a3e112ac02f8a261293cbe605db2e5d8732d3 05-Sep-2008 Daniel Dunbar <daniel@zuster.org> Set sext/zext on function result.
- <rdar://problem/6156739>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f80519b919a348db004fba18530706314d1ebfb5 05-Sep-2008 Daniel Dunbar <daniel@zuster.org> Set function attributes (sext, zext, etc.) on Objective-C methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
90df4b6661968a84bf64baee489bb2f6d948fcc1 04-Sep-2008 Daniel Dunbar <daniel@zuster.org> Avoid superfluous errors regarding variable-length arrays (casts).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b381aac9bae6d608c72267dd0ed08ec6369e94e4 01-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> codegen constant data as such. add QualType::isConstant()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
662174c82ef46b19a2329c7d37208e1d12dfb7b3 29-Aug-2008 Daniel Dunbar <daniel@zuster.org> Downgrade a number of FIXME asserts to ErrorUnsupported.
- Notably VLAs


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
af05bb9073319d8381b71c4325188853fd4b8ed6 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Objective-C @synthesize support.
- Only supports simple assignment and atomic semantics are ignored.
- Not quite usable yet because the methods do not actually get added
to the class metadata.
- Added ObjCPropertyDecl::getSetterKind (one of Assign, Copy, Retain).
- Rearrange CodeGenFunction so synthesis can reuse function prolog /
epilog code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
90db88249ac92e6ed515065048a4ead4467e6639 25-Aug-2008 Daniel Dunbar <daniel@zuster.org> Use DenseMap on IdentifierInfo instead of StringMap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3e9df9920db8de8ec93a424b0c1784f9bff301ea 23-Aug-2008 Daniel Dunbar <daniel@zuster.org> NeXT: Clean up constant CFString handling.
- Use CodeGenModule::GetAddrOfConstantCFString

Some tweaks of CodeGenModule::GetAddrOfConstantCFString


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
b7ec246872b412f0e7bb9e93eacfd78cfa6adfb3 16-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add NeXT runtime support for generating methods.

Change CodeGenFunction::EmitParmDecl to take either a ParmVarDecl or an
ImplicitParamDecl.

Drop hasAggregateLLVMType from CodeGenModule.cpp (use version in
CodeGenFunction).

Change the Objective-C method generation to use EmitParmDecl for
implicit parameters.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
41071debe9b8887449c3f2ee0dd7124ed47bdda8 16-Aug-2008 Daniel Dunbar <daniel@zuster.org> Clean up CodeGenModule interface.
- Add CodeGenModule::EmitTopLevelDecl which uses switch on kind
instead of ugly & slow dyn_cast chains.

- Drop some simple forwarding methods into the ObjC runtime.

- Privatize appropriate methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
7ded7f4983dc4a20561db7a8d02c6b2435030961 16-Aug-2008 Daniel Dunbar <daniel@zuster.org> Change CGObjCRuntime methods to take appropriate clang Decls.
- This is in prep for implementation class support for the NeXT
runtime, for which the existing methods don't provide enough
information (and additionally make too many assumptions about how
things should be emitted).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9d9b09c86a8c69e8f69364f610563cdb86f2b8b7 15-Aug-2008 Daniel Dunbar <daniel@zuster.org> Infinite loops considered harmful.
- Thanks Thomas


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

Rename getStringForStringLiteral to GetStringForStringLiteral.

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

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


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

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

Also moved CGObjCRuntime.h out of CodeGenModule.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0d8a13d823b644d94ae5f8db275be3592b9bbbfc 12-Aug-2008 Mike Stump <mrs@apple.com> Fix compilation warning with help from David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
f77ac86f4eca528a04b817d7ad7f045a47d52712 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add LangOptions::NeXTRuntime.
- Wired to -fnext-runtime and -fgnu-runtime options.
- Defaults to GNU, no autoselection for NeXT.

Emit NeXT OBJC_IMAGE_INFO marker.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6379a7a15335e0af543a942efe9cfd514a83dab8 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add -fexceptions to Driver
- Maps to LangOptions.Exceptions
- Currently always off, should autoselect based on language.

Update CodeGen to set unwind attribute on functions definitions based
on LangOptions.Exceptions.
- Still need to set attributes appropriately on calls.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c4a1dea2dc56bd1357ec91b829a0b9e68229a13e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
- Moved Sema::getCurMethodDecl() out of line (dependent on
ObjCMethodDecl via dyn_cast).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c17a4d3b16a2624a76de5d7508805534545bd3bf 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add dummy Mac Objective-C runtime interface.
- Not currently accessible and completely non-functional.


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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
ec5c2a7646e4e23a4bed77443415938b140d7aa7 10-Aug-2008 Daniel Dunbar <daniel@zuster.org> Bug fix, inline string literals were getting an extra '\0'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a735ad8be5536a1cd3e9817ec27dfeb2a0c1d5ca 06-Aug-2008 Daniel Dunbar <daniel@zuster.org> Implement GNU asm-label extension support in CodeGen. This fixes
scimark2 on Darwin.

- Added Sema support for asm-label on variables, which I forgot before.

- Update CodeGen to use GlobalDeclMap to determine if static Decls
require emission (instead of LLVM module name lookup). Important
since the Decl name and the LLVM module name can differ.

- <rdar://problem/6116729>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3c827a79cb7d04c255db8080e682ee2c6912373d 06-Aug-2008 Daniel Dunbar <daniel@zuster.org> Change CodeGen of global decls to key off of the name (instead of
having multiple bindings from all the possible decls which
conceptually map to the same global).

- This eliminates CodeGen depending on the LLVM module for name
lookup.

- This also eliminates the need for ReplaceMapValuesWith (hurrah).

- This handles lookups for FunctionDecls correctly in the presence of
aliases, this was previously broken.

- WIP: Can still clean up & unify variable and function emission.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
815c78fd9ab8bd5dfe8e8a91b8c6a413e2b8c889 05-Aug-2008 Ted Kremenek <kremenek@apple.com> Refactored driver logic for CodeGen into LLVMCodeGenWriter. This ASTConsumer layers on top of LLVMCodeGen (another existing ASTConsumer) to emit bitcode files to disk. This layering takes this logic out of clang.cpp and puts it directly into the ASTConsumer interface. The benefit is that now --emit-llvm works with both serialized ASTs and regular source files.


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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6bfed7e411adc46eaf616371f85f68305c6e6257 01-Aug-2008 Daniel Dunbar <daniel@zuster.org> Support constructor and destructor attributes in CodeGen

- There is an miscompilation issue remaining due to a poor
interaction between the delayed emission of static functions and
the emission of constructors, but that already existed prior to
this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
9986eabd4423d867262c358ca62f94a60ac58412 30-Jul-2008 Daniel Dunbar <daniel@zuster.org> Change CodeGenModule GlobalDeclMap to directly reference globals
instead of mapping the decl to a bitcast of the global to the correct
type.

- GetAddrOf{Function,GlobalVar} introduce the bitcast on every use now.

- This solves a problem where a dangling pointer could be introduced
by the RAUW done when replacing a forward or tentative
definition. See testcase for more details.

- Fixes <rdar://problem/6108358>


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

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

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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
58a7a265cf9203795e718d12c074f103e6b27e73 29-Jul-2008 Daniel Dunbar <daniel@zuster.org> Fix codegen of chained declarations
- Killed useless CodeGenModule::EmitGlobalVarDeclarator, instead just
recurse on any ScopedDecl.
- Fix for <rdar://problem/6093838>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
780f329cb011bff0da5763e2e9744eec093d0509 21-Jul-2008 Chris Lattner <sabre@nondot.org> move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,
simplifying code along the way and fixing a problem and memory leak or two.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
3db6cae19c236fe2cef343c90105ce7cca7de965 21-Jul-2008 Chris Lattner <sabre@nondot.org> introduce a new ObjCList templated class and start moving
various objc lists over to it. First up, the protocol list
on ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a4210076fc1d7ac0a20b8b4a79e18a8ae33b9c69 26-Jun-2008 Chris Lattner <sabre@nondot.org> refactor more objc codegen interfaces to pass around selectors so
we don't push strings into LLVM IR and then have to read them back out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
fba676396703e87a5034e5f308aa30a633468f66 26-Jun-2008 Chris Lattner <sabre@nondot.org> indenting and other minor things.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52764 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
dce1406f1c1f572cfd61c494546572d63461c741 26-Jun-2008 Chris Lattner <sabre@nondot.org> give CreateObjCRuntime a full CGM so it can get whatever state it needs,
instead of passing in just a couple random things it currently
happens to use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
d4cbda6292b321c2e7dce7f039d92918fee99b3a 08-Jun-2008 Nuno Lopes <nunoplopes@sapo.pt> implement the alias attirbute (in both Sema and Codegen)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
686226b538e72c5059ab7c9a8f87eb883193b645 05-Jun-2008 Sanjiv Gupta <sanjiv.gupta@microchip.com> Emit debug information for global and static variables when -g is specified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
c134fcb0d7989fe6937e47e6216637647e074aef 04-Jun-2008 Eli Friedman <eli.friedman@gmail.com> For setting attributes, don't assume there are ParamVarDecls available,
because trying to access non-existent ParamVarDecls can crash.
Testcase from the original source for PR2414.



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

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

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



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
cd5f4aaf0c219189878126d556f35e38fdb8afa1 30-May-2008 Eli Friedman <eli.friedman@gmail.com> PR1893: Fix up the type of tentative definitions of incomplete array
types so that they end up the correct size.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
77ba708819285931932ecd33691a672bb59d221a 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Allow the type of a global to be different from the type of its
associated declaration. This is a prerequisite to handling
general union initializations; for example, an array of unions involving
pointers has to be turned into a struct because the elements can have
incompatible types.

I refactored the code a bit to make it more readable; now, the logic for
definitions is all in EmitGlobalVarInit.

The second parameter for GetAddrOfGlobalVar is now dead; I'll remove it
separately.

By itself, this patch should not cause any visible changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
109603de14dfe69f3eb9b264a273b38e5684c8de 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Always check that the definition of a function has the correct type.
This fixes a crash on the included testcase (found in NetHack).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
08d7802a406ee4a7cc18e8fce0c137b8c410ea7c 29-May-2008 Eli Friedman <eli.friedman@gmail.com> Add CodeGen support for alignment on globals, both for unusual natural
alignment and alignment attributes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a07b76419a03f126c22949dce2e546ba4df0e415 29-May-2008 Eli Friedman <eli.friedman@gmail.com> Tentative declarations are supposed to have common linkage, not weak.
This change makes clang generate the same thing as llvm-gcc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a1d642db810e317da011569309ee0693d51b7dff 27-May-2008 Eli Friedman <eli.friedman@gmail.com> The cache is working again; re-enable it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51587 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
6f7e2eee917a136ffc36834f020782b3f15d8fa6 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Add a more reliable check for whether a static declaration has already
been used. In preparation for the fix to PR2360, but also a minor bug
in its own right.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
0c99509927a0c7a48490486b9fec287b63e5c09c 26-May-2008 Eli Friedman <eli.friedman@gmail.com> Emit memmove, not memcpy, for structure copies; this is unfortunately
required for correctness in cases of copying a struct to itself or to
an overlapping struct (itself for cases like *a = *a, and overlapping
is possible with unions).

Hopefully, this won't end up being a perf issue; LLVM *should* be able
to optimize memmove to memcpy in a lot of cases, and for small copies
the generated code *should* be mostly comparable. (In reality, LLVM
is currently horrible at optimizing memmove, but that's a bug, not a
fundamental issue.)

gcc currently generates wrong code; that's
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4f8d123e3e2c260de3377208106ddba87cee28b4 22-May-2008 Dan Gohman <gohman@apple.com> Move getAccessedFieldNo out of lib/AST/Expr.cpp into
lib/CodeGen/CGExpr.cpp and to change include/clang/AST/Attr.h to
use its own enum for visibility types instead of using
llvm::GlobalValue::VisibilityTypes. These changes eliminate
dependencies in the AST library on LLVM's VMCore library.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
be14c5c6e29af948f6f809c499f83d844e755af9 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Disable the function address cache; this doesn't have any ill effects,
as far as I can tell, and it fixes code like test/CodeGen/functions.c.

(Whatever performance effect it might have, crashing on a
construct like this isn't really acceptable; I've run into this
multiple times.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
e8b9f5b8ea60983c4a74cb8b63879616b914b65a 08-May-2008 Sanjiv Gupta <sanjiv.gupta@microchip.com> Added -g command line options to clang for generating source level debug information. This patch currently enables generation of line number debug information (stoppoints) and region begin/end debug information. The new files CGDebugInfo.h and CGDebugInfo.cpp implements the debug info manager class CGDebugInfo.


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
a1945fa74d04098d7e22d7c31585342555eca928 30-Apr-2008 Chris Lattner <sabre@nondot.org> Verify the whole module after codegen to catch silly IR bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
5827754da1773a7288480ce34bdf1f0a909fff21 25-Apr-2008 Chris Lattner <sabre@nondot.org> remove the 'unused static' diagnostic from codegen. This should be
reimplemented in Sema someday. This is tracked in PR2236. Until then
disabling it removes some bogus diagnostics (see 2236).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
1a1d92ac5e1354634af08c62a1d72e263d13be0c 20-Apr-2008 Nate Begeman <natebegeman@mac.com> Fix PR2236
Add test
Implement feedback from Chris re: PR1998


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
4c13b7a3973d2d263d9682d7b68fbfeb76334af5 20-Apr-2008 Nate Begeman <natebegeman@mac.com> Only generate code for static functions and global variables that are actually used.
Warn about unused static functions and variables.
This fixes PR1998.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
8bd4afeb876fd0015bb808eb2f3de1fe709658a7 19-Apr-2008 Nate Begeman <natebegeman@mac.com> Generate code for annotation attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
532485cc6c078d9e51b517c6bbd8984deb17f0fe 19-Apr-2008 Nate Begeman <natebegeman@mac.com> Add support to module codegen for adding and emitting annotations


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

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


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

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

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

David, please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
391d77a26382dddf25da73e29fc1fa5aaaea4c6f 31-Mar-2008 Chris Lattner <sabre@nondot.org> Add initial support for objc codegen for methods, ivars, and the
etoile runtime, patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CodeGenModule.cpp
572cf09ae8a78af1c56d40b016ec4cf1837163ac 19-Mar-2008 Chris Lattner <sabre@nondot.org> simplify code by using the variadic StructType::get method.


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


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