summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rework codegen emission of globalsDaniel Dunbar2008-07-291-163/+181
| | | | | | | | | | | | | | | | | | | | - 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. llvm-svn: 54179
* Fix codegen of chained declarationsDaniel Dunbar2008-07-291-8/+0
| | | | | | | | - Killed useless CodeGenModule::EmitGlobalVarDeclarator, instead just recurse on any ScopedDecl. - Fix for <rdar://problem/6093838> llvm-svn: 54162
* move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,Chris Lattner2008-07-211-4/+5
| | | | | | simplifying code along the way and fixing a problem and memory leak or two. llvm-svn: 53876
* introduce a new ObjCList templated class and start moving Chris Lattner2008-07-211-5/+9
| | | | | | | various objc lists over to it. First up, the protocol list on ObjCInterfaceDecl. llvm-svn: 53856
* refactor more objc codegen interfaces to pass around selectors soChris Lattner2008-06-261-19/+17
| | | | | | we don't push strings into LLVM IR and then have to read them back out. llvm-svn: 52765
* indenting and other minor things.Chris Lattner2008-06-261-2/+2
| | | | llvm-svn: 52764
* give CreateObjCRuntime a full CGM so it can get whatever state it needs, Chris Lattner2008-06-261-3/+1
| | | | | | | instead of passing in just a couple random things it currently happens to use. llvm-svn: 52756
* implement the alias attirbute (in both Sema and Codegen)Nuno Lopes2008-06-081-17/+39
| | | | llvm-svn: 52092
* Emit debug information for global and static variables when -g is specified.Sanjiv Gupta2008-06-051-0/+8
| | | | llvm-svn: 51993
* For setting attributes, don't assume there are ParamVarDecls available, Eli Friedman2008-06-041-12/+16
| | | | | | | because trying to access non-existent ParamVarDecls can crash. Testcase from the original source for PR2414. llvm-svn: 51960
* First cut at setting attributes for functions and calls; this puts us Eli Friedman2008-06-011-3/+62
| | | | | | | | | | | | | | | 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. llvm-svn: 51839
* Support for code generation of Objective-C top-level language constructs.Anton Korobeynikov2008-06-011-1/+151
| | | | | | Implemented by David Chisnall! llvm-svn: 51835
* PR1893: Fix up the type of tentative definitions of incomplete array Eli Friedman2008-05-301-2/+22
| | | | | | types so that they end up the correct size. llvm-svn: 51787
* Allow the type of a global to be different from the type of its Eli Friedman2008-05-301-69/+62
| | | | | | | | | | | | | | | | | 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. llvm-svn: 51783
* Always check that the definition of a function has the correct type. Eli Friedman2008-05-301-1/+1
| | | | | | This fixes a crash on the included testcase (found in NetHack). llvm-svn: 51767
* Add CodeGen support for alignment on globals, both for unusual natural Eli Friedman2008-05-291-0/+6
| | | | | | alignment and alignment attributes. llvm-svn: 51676
* Tentative declarations are supposed to have common linkage, not weak. Eli Friedman2008-05-291-1/+1
| | | | | | This change makes clang generate the same thing as llvm-gcc. llvm-svn: 51674
* The cache is working again; re-enable it.Eli Friedman2008-05-271-3/+0
| | | | llvm-svn: 51587
* Add a more reliable check for whether a static declaration has already Eli Friedman2008-05-271-17/+12
| | | | | | | been used. In preparation for the fix to PR2360, but also a minor bug in its own right. llvm-svn: 51583
* Emit memmove, not memcpy, for structure copies; this is unfortunately Eli Friedman2008-05-261-1/+13
| | | | | | | | | | | | | | | | | 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. llvm-svn: 51566
* Move getAccessedFieldNo out of lib/AST/Expr.cpp intoDan Gohman2008-05-221-1/+19
| | | | | | | | | 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. llvm-svn: 51398
* Disable the function address cache; this doesn't have any ill effects, Eli Friedman2008-05-201-1/+4
| | | | | | | | | | 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.) llvm-svn: 51312
* Added -g command line options to clang for generating source level debug ↵Sanjiv Gupta2008-05-081-2/+9
| | | | | | 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. llvm-svn: 50848
* Simplify FunctionDecl::AddRedeclaration a bit by using std::swap.Chris Lattner2008-05-041-20/+22
| | | | | | | Fix 'swapping' of attributes to not insert null values into the DeclAttrs map. llvm-svn: 50612
* if a decl is both 'static' and weak or static and inline, its linkageChris Lattner2008-05-041-7/+6
| | | | | | type should be internal, not weak/linkonce. llvm-svn: 50611
* Verify the whole module after codegen to catch silly IR bugs.Chris Lattner2008-04-301-0/+4
| | | | llvm-svn: 50485
* remove the 'unused static' diagnostic from codegen. This should be Chris Lattner2008-04-251-8/+0
| | | | | | | reimplemented in Sema someday. This is tracked in PR2236. Until then disabling it removes some bogus diagnostics (see 2236). llvm-svn: 50263
* Fix PR2236Nate Begeman2008-04-201-5/+17
| | | | | | | Add test Implement feedback from Chris re: PR1998 llvm-svn: 50001
* Only generate code for static functions and global variables that are ↵Nate Begeman2008-04-201-5/+68
| | | | | | | | | actually used. Warn about unused static functions and variables. This fixes PR1998. llvm-svn: 49987
* Generate code for annotation attributes.Nate Begeman2008-04-191-0/+51
| | | | llvm-svn: 49951
* Add support to module codegen for adding and emitting annotationsNate Begeman2008-04-181-0/+17
| | | | llvm-svn: 49944
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-151-4/+5
| | | | | | | | 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). llvm-svn: 49748
* tracking API changes arising from r49277Gabor Greif2008-04-061-3/+3
| | | | llvm-svn: 49279
* some cleanups on top of David's patch. There are still twoChris Lattner2008-03-301-7/+5
| | | | | | | | | | | | | 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. llvm-svn: 48970
* Add initial support for objc codegen for methods, ivars, and theChris Lattner2008-03-301-1/+18
| | | | | | etoile runtime, patch by David Chisnall! llvm-svn: 48969
* simplify code by using the variadic StructType::get method.Chris Lattner2008-03-191-21/+19
| | | | llvm-svn: 48535
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+509
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. llvm-svn: 48402
OpenPOWER on IntegriCloud