History log of /external/clang/lib/CodeGen/CodeGenModule.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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