summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
AgeCommit message (Collapse)Author
2009-03-21Issue error if variables are defined inside an objc class,Fariborz Jahanian
category or protocol. llvm-svn: 67450
2009-03-21now that all the decl reference and creation stuff is going through twoChris Lattner
very simple places, reimplement the deferred decl emission logic to not be O(N^2), fixing PR3810. llvm-svn: 67447
2009-03-21fix a crash that could occur when a variable declaration became aChris Lattner
function definition. llvm-svn: 67446
2009-03-21simplify and cleanup global variable creation stuff to all go through oneChris Lattner
code path. llvm-svn: 67445
2009-03-21simplify management of llvm::Function creation to all go throughChris Lattner
GetAddrOfFunction. This is simpler and more efficient. llvm-svn: 67444
2009-03-21code cleanups, rename EmitForwardFunctionDefinition -> Chris Lattner
CreateFunctionPrototypeIR, though my next patch will eliminate it entirely. llvm-svn: 67443
2009-03-21fix several problems with asm renaming, by pulling it into the mangling code:Chris Lattner
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. llvm-svn: 67442
2009-03-21add some fixmesChris Lattner
llvm-svn: 67441
2009-03-21reduce redundant calls of getMangledName.Chris Lattner
llvm-svn: 67440
2009-03-21simplify some more code.Chris Lattner
llvm-svn: 67439
2009-03-21simplify and comment some code better. Make BindRuntimeGlobalsChris Lattner
more optimistic that it will work (optimizing for the common case). llvm-svn: 67438
2009-03-21random code cleanups.Chris Lattner
llvm-svn: 67437
2009-03-21remove obviously dead code: you can't bitcast a pointer to "Ty" (a function ↵Chris Lattner
type). llvm-svn: 67436
2009-03-21avoid making constant folding logic eliminate obviously dead bitcasts, ↵Chris Lattner
speeding up PR3810 by ~2%. llvm-svn: 67434
2009-03-21Add a fast path to CodeGenModule::getMangledName for almost all C functions,Chris Lattner
speeding up the testcase in PR3810 by 60%. llvm-svn: 67431
2009-03-19IRgen support for alias of global variable.Daniel Dunbar
- PR3818. llvm-svn: 67297
2009-03-18objc: Implemented variables declared in class interface Fariborz Jahanian
whose sema decl is at the translation unit. llvm-svn: 67249
2009-03-11Adjust for linkage name change.Duncan Sands
llvm-svn: 66691
2009-03-11Correct for change of this name in LLVM.Duncan Sands
llvm-svn: 66652
2009-03-09Backout r66408, we don't want handling of globals to rely on theDaniel Dunbar
module symbol table. The root problem inspiring this was fixed in r66316 (and again in r66506). llvm-svn: 66512
2009-03-09Be sure to never create two functions with the same name, instead arrange toMike Stump
reuse the prior one. llvm-svn: 66408
2009-03-07Make constant emission for @encode use the common string emission code. Eli Friedman
This is a bit cleaner, and also "fixes" bad code that compares the addresses of the string constants. llvm-svn: 66346
2009-03-07Fixup our uses of various linkages to match how llvm now works. I think ↵Mike Stump
they are all correct, but an extra set of ObjC eyes would be good. llvm-svn: 66342
2009-03-06(LLVM svn up) Generalize RuntimeFunctions to RuntimeGlobals and addDaniel Dunbar
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. llvm-svn: 66292
2009-03-06IRgen support for weak_import.Daniel Dunbar
- <rdar://problem/6652110> clang should support weak_import llvm-svn: 66270
2009-03-05Don't mangle names of local variables.Daniel Dunbar
- 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. llvm-svn: 66212
2009-03-05Make IRGen compatible with declaring a function with incomplete Eli Friedman
return/argument types. (The generated IR isn't ideal, but we can't really do better in general.) llvm-svn: 66132
2009-03-04Move more of the blocks code up and out.Mike Stump
llvm-svn: 66046
2009-03-04Move more of blocks codegen out of CodeGenModule and into theMike Stump
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. llvm-svn: 66042
2009-03-04Support "asm" renaming of external symbols.Daniel Dunbar
- PR3698. llvm-svn: 66038
2009-03-02Don't set nounwind on functions when in using the new Obj-C ABI.Daniel Dunbar
llvm-svn: 65806
2009-03-01simplify some code.Chris Lattner
llvm-svn: 65782
2009-03-01Initialize NSConcreteStackBlockAnders Carlsson
llvm-svn: 65749
2009-02-27Fix PR3612. We ensure that we add builtins to the GlobalDeclMap andMike Stump
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. llvm-svn: 65657
2009-02-27Minor cleanup: use getDeclAlignInBytes helper.Eli Friedman
llvm-svn: 65611
2009-02-26fix some sema problems with wide strings and hook up basic codegen for them.Chris Lattner
llvm-svn: 65582
2009-02-24first wave of fixes for @encode sema support. This is part of PR3648.Chris Lattner
The big difference here is that (like string literal) @encode has array type, not pointer type. llvm-svn: 65391
2009-02-21Emit extern_weak when needed.Daniel Dunbar
- PR3629. llvm-svn: 65203
2009-02-20Initialize the Init variable to something reasonable when we emit an Eli Friedman
error, so we don't crash. llvm-svn: 65099
2009-02-19Add irgen support for the noinline attribute.Anders Carlsson
llvm-svn: 65056
2009-02-19Don't emit K&R unprototyped function definitions as varargs.Daniel Dunbar
- <rdar://problem/6584606> clang/x86-64 - too many reg saves llvm-svn: 65032
2009-02-19Emission of global variable initialializer was broken in rareDaniel Dunbar
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. llvm-svn: 65018
2009-02-18Address Chris's comments regarding C++ name mangling.Douglas Gregor
llvm-svn: 64984
2009-02-18Add anti-FIXME.Daniel Dunbar
llvm-svn: 64969
2009-02-18Simplify.Daniel Dunbar
llvm-svn: 64944
2009-02-14Make it possible for builtins to expression FILE* arguments, so thatDouglas Gregor
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. llvm-svn: 64526
2009-02-13Implicitly declare certain C library functions (malloc, strcpy, memmove,Douglas Gregor
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. llvm-svn: 64504
2009-02-13Simplify predicate.Daniel Dunbar
llvm-svn: 64500
2009-02-13IRgen support for attribute used.Daniel Dunbar
- PR3566 llvm-svn: 64492
2009-02-13Pull MayDeferGeneration out of EmitGlobal.Daniel Dunbar
- Fix emission of static functions with constructor attribute while I was here. <rdar://problem/6140899> [codegen] "static" and attribute-constructor interact poorly llvm-svn: 64488