summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Avoid superfluous errors regarding variable-length arrays (casts).Daniel Dunbar2008-09-041-3/+9
| | | | llvm-svn: 55759
* Objective-C @synthesize support.Daniel Dunbar2008-08-261-0/+1
| | | | | | | | | | | - 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. llvm-svn: 55365
* Use DenseMap on IdentifierInfo instead of StringMap.Daniel Dunbar2008-08-251-1/+2
| | | | llvm-svn: 55303
* NeXT: Clean up constant CFString handling.Daniel Dunbar2008-08-231-0/+4
| | | | | | | | - Use CodeGenModule::GetAddrOfConstantCFString Some tweaks of CodeGenModule::GetAddrOfConstantCFString llvm-svn: 55243
* Change WarnUnsupported to ErrorUnsupported (in name and in practice).Daniel Dunbar2008-08-161-4/+4
| | | | | | | - We are beyond the point where this shows up often and when it does generating miscompiled files is bad. llvm-svn: 54836
* Clean up CodeGenModule interface.Daniel Dunbar2008-08-151-22/+15
| | | | | | | | | | | - 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. llvm-svn: 54827
* Add GetAddrOfConstantCString methodDaniel Dunbar2008-08-131-5/+24
| | | | | | | | | | | | | | | | | | - 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> llvm-svn: 54768
* Change ObjCRuntime GenerateProtocol[Ref] methods to takeDaniel Dunbar2008-08-131-1/+1
| | | | | | | | | | | ObjCProtocolDecl directly. Implement CodeGen support for forward protocol decls (no-ops are so nice to implement). Also moved CGObjCRuntime.h out of CodeGenModule.h llvm-svn: 54709
* Add LangOptions::NeXTRuntime.Daniel Dunbar2008-08-111-1/+1
| | | | | | | | | - Wired to -fnext-runtime and -fgnu-runtime options. - Defaults to GNU, no autoselection for NeXT. Emit NeXT OBJC_IMAGE_INFO marker. llvm-svn: 54651
* Change CodeGenModule to only create ObjC runtime for ObjC filesDaniel Dunbar2008-08-111-1/+11
| | | | | | | - Changed CodeGenModule::getObjCRuntime to return reference. - Added CodeGenModule::hasObjCRuntime predicate. llvm-svn: 54645
* Add dummy Mac Objective-C runtime interface.Daniel Dunbar2008-08-111-1/+1
| | | | | | - Not currently accessible and completely non-functional. llvm-svn: 54624
* Back out r54608 (inline string literals were getting an extra '\0')Daniel Dunbar2008-08-101-0/+5
| | | | | | | | | | | | | | | 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! llvm-svn: 54621
* Change CodeGen of global decls to key off of the name (instead ofDaniel Dunbar2008-08-051-9/+6
| | | | | | | | | | | | | | | | | 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. llvm-svn: 54382
* Remove excess #include.Ted Kremenek2008-08-051-1/+0
| | | | llvm-svn: 54366
* Refactored driver logic for CodeGen into LLVMCodeGenWriter. This ↵Ted Kremenek2008-08-051-2/+7
| | | | | | 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. llvm-svn: 54364
* Support constructor and destructor attributes in CodeGenDaniel Dunbar2008-08-011-3/+22
| | | | | | | | | - 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. llvm-svn: 54258
* Change CodeGenModule GlobalDeclMap to directly reference globalsDaniel Dunbar2008-07-301-2/+7
| | | | | | | | | | | | | | | 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> llvm-svn: 54211
* Rework codegen emission of globalsDaniel Dunbar2008-07-291-17/+34
| | | | | | | | | | | | | | | | | | | | - 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-1/+0
| | | | | | | | - Killed useless CodeGenModule::EmitGlobalVarDeclarator, instead just recurse on any ScopedDecl. - Fix for <rdar://problem/6093838> llvm-svn: 54162
* implement the alias attirbute (in both Sema and Codegen)Nuno Lopes2008-06-081-0/+3
| | | | llvm-svn: 52092
* First cut at setting attributes for functions and calls; this puts us Eli Friedman2008-06-011-0/+5
| | | | | | | | | | | | | | | 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-0/+6
| | | | | | Implemented by David Chisnall! llvm-svn: 51835
* Emit memmove, not memcpy, for structure copies; this is unfortunately Eli Friedman2008-05-261-0/+2
| | | | | | | | | | | | | | | | | 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-0/+6
| | | | | | | | | 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
* Added -g command line options to clang for generating source level debug ↵Sanjiv Gupta2008-05-081-2/+6
| | | | | | 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
* Fix PR2236Nate Begeman2008-04-201-3/+2
| | | | | | | 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-0/+4
| | | | | | | | | actually used. Warn about unused static functions and variables. This fixes PR1998. llvm-svn: 49987
* Generate code for annotation attributes.Nate Begeman2008-04-191-1/+4
| | | | llvm-svn: 49951
* Add support to module codegen for adding and emitting annotationsNate Begeman2008-04-181-0/+3
| | | | llvm-svn: 49944
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-151-3/+2
| | | | | | | | 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
* Add initial support for objc codegen for methods, ivars, and theChris Lattner2008-03-301-0/+2
| | | | | | etoile runtime, patch by David Chisnall! llvm-svn: 48969
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+129
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