summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Improved ABI compliance for __block variables. No testcases yet as weMike Stump2009-03-041-0/+9
| | | | | | | still give an unsupported error for them due to the fact this is a work in progress. llvm-svn: 66007
* Fix PR3612. We ensure that we add builtins to the GlobalDeclMap andMike Stump2009-02-271-2/+2
| | | | | | | | | 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
* first wave of fixes for @encode sema support. This is part of PR3648.Chris Lattner2009-02-241-0/+5
| | | | | | | The big difference here is that (like string literal) @encode has array type, not pointer type. llvm-svn: 65391
* Prevent accidental copying of CodeGenFunction and CodeGenModule.Anders Carlsson2009-02-241-0/+3
| | | | llvm-svn: 65372
* Don't emit K&R unprototyped function definitions as varargs.Daniel Dunbar2009-02-191-1/+10
| | | | | | - <rdar://problem/6584606> clang/x86-64 - too many reg saves llvm-svn: 65032
* More codegen for blocks. The type of block literals should be better.Mike Stump2009-02-191-0/+2
| | | | | | The size calculation is improved. llvm-svn: 64994
* Address Chris's comments regarding C++ name mangling.Douglas Gregor2009-02-181-9/+19
| | | | llvm-svn: 64984
* Change EmitConstantExpr to allow failure.Daniel Dunbar2009-02-171-0/+5
| | | | | | | | | | | | | | IRgen no longer relies on isConstantInitializer, instead we just try to emit the constant. If that fails then in C we emit an error unsupported (this occurs when Sema accepted something that it doesn't know how to fold, and IRgen doesn't know how to emit) and in C++ we emit a guarded initializer. This ends up handling a few more cases, because IRgen was actually able to emit some of the constants Sema accepts but can't Evaluate(). For example, PR3398. llvm-svn: 64780
* Use getNameAsCString instead of getNameAsString and reflow the type.Mike Stump2009-02-141-1/+1
| | | | | | Thanks Anders. llvm-svn: 64571
* Generate the helper function for blocks. Now basic codegen isMike Stump2009-02-141-1/+1
| | | | | | starting to work for blocks. llvm-svn: 64570
* IRgen support for attribute used.Daniel Dunbar2009-02-131-0/+7
| | | | | | - PR3566 llvm-svn: 64492
* Pull MayDeferGeneration out of EmitGlobal.Daniel Dunbar2009-02-131-0/+5
| | | | | | | | - 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
* Rename EmitStatics (etc) to EmitDeferred; provide basic infrastructureDaniel Dunbar2009-02-131-7/+25
| | | | | | | for attribute used support. - No functionality change. llvm-svn: 64487
* Let the backend unique these.Mike Stump2009-02-131-2/+0
| | | | llvm-svn: 64486
* Move DescriptorUniqueCount into CGM.Mike Stump2009-02-131-1/+3
| | | | llvm-svn: 64481
* Move NSConcreteStackBlock into CGM.Mike Stump2009-02-131-0/+5
| | | | llvm-svn: 64479
* Reflow to 80col.Mike Stump2009-02-131-91/+84
| | | | llvm-svn: 64475
* Move GlobalUniqueCount up into CGM.Mike Stump2009-02-131-1/+4
| | | | llvm-svn: 64473
* Condense NSConcreteGlobalBlock handling.Mike Stump2009-02-131-0/+2
| | | | llvm-svn: 64461
* Move GenericBlockLiteralType into CGM.Mike Stump2009-02-131-0/+3
| | | | llvm-svn: 64452
* Move BlockDescriptorType into CGM.Mike Stump2009-02-131-1/+5
| | | | llvm-svn: 64451
* Add basic support for C++ name mangling according to the Itanium C++Douglas Gregor2009-02-131-0/+4
| | | | | | | | | | | | | | | | 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. llvm-svn: 64413
* Add a very basic implemenation of global blocks. This needs to be cleaned up.Anders Carlsson2009-02-121-0/+7
| | | | llvm-svn: 64387
* More ABI API cleanup.Daniel Dunbar2009-02-021-3/+3
| | | | | | | - Lift CGFunctionInfo creation above ReturnTypeUsesSret and EmitFunction{Epi,Pro}log. llvm-svn: 63553
* Kill off CGCallInfo, always use CGFunctionInfo for encapsulatingDaniel Dunbar2009-01-311-2/+1
| | | | | | function/call info. llvm-svn: 63466
* Fix the bug that would cause Python to crash at startup.Anders Carlsson2009-01-041-1/+3
| | | | | | | 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. llvm-svn: 61621
* Add option argument to GetAddrOfConstantString to use for name ofDaniel Dunbar2008-10-171-3/+11
| | | | | | | (first) global holding the string. - No functionality change. llvm-svn: 57736
* Add simple interface for protecting runtime functions from nameDaniel Dunbar2008-10-011-0/+13
| | | | | | | | | | | | | | | | | 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. llvm-svn: 56899
* Large mechanical patch.Devang Patel2008-09-251-3/+3
| | | | | | | | | | | | | 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. llvm-svn: 56623
* Move FunctionType conversion into CGCall.cpp:Daniel Dunbar2008-09-101-1/+2
| | | | | | | | | | | | | - 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. llvm-svn: 56047
* Tweak CGCall functions again:Daniel Dunbar2008-09-101-0/+14
| | | | | | | | - Realized these functions will eventually need access to more data, moved to CodeGenModule. Eventually they should probably live together in some other helper class. llvm-svn: 56039
* Fix a number of issues w.r.t. emission of global for functions andDaniel Dunbar2008-09-081-7/+14
| | | | | | | | | | | | | | 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. llvm-svn: 55966
* Refactor parameter attribute handling:Daniel Dunbar2008-09-081-3/+0
| | | | | | | | | - 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 llvm-svn: 55963
* Set function attributes (sext, zext, etc.) on Objective-C methods.Daniel Dunbar2008-09-041-2/+8
| | | | llvm-svn: 55812
* 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
OpenPOWER on IntegriCloud