aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.h
AgeCommit message (Collapse)Author
2009-06-29Improve code generation for function template specializations:Douglas Gregor
- 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
2009-05-26Handle the edge case of a weak function with incomplete type correctly. Eli Friedman
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
2009-05-12push GlobalDecl through enough of the CodeGenModule interfacesChris Lattner
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
2009-05-05Refactor global decls to hold either a regular Decl or a CXXConstructorDecl ↵Anders Carlsson
+ ctor type or a CXXDestructorDecl + dtor type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21Explictly track tentative definitions within Sema, then hand thoseDouglas Gregor
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
2009-04-17Add support for generating (very basic) C++ destructors. These aren't called ↵Anders Carlsson
by anything yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17Attributes on block functions were not being set.Daniel Dunbar
- <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
2009-04-16Add GetAddrOfCXXConstructor and use it.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15Defer generation of tentative definitions.Daniel Dunbar
- 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
2009-04-15Start attempting to generate code for C++ ctors.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69168 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14remove dead enumChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14Fix PR3988: extern inline functions get strong symbol definitions inChris Lattner
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
2009-04-14implement codegen support for __attribute((__gnuc_inline__)),Chris Lattner
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
2009-04-14Refactor how attributes are set on values.Daniel Dunbar
- 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
2009-04-14Split SetGlobalValueAttributes into definition/declaration halves.Daniel Dunbar
- No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69035 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14Rename (one) SetFunctionAttributes to SetLLVMFunctionAttributes toDaniel Dunbar
disambiguate it. - No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69034 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14add a new enum type for linkage, no functionality change.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69028 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14Clean up handling of visibility.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13Minor work related to removing the assumption that value initialization Eli Friedman
implies an all-zero bit pattern. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08Add a destination type argument to EmitConstantExpr. This will be used for ↵Anders Carlsson
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
2009-04-02Emit code for linkage specifications.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68300 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01More "prep" work for handling UTF16 CFString.Steve Naroff
Patch by Jean-Daniel Dupas. Thanks! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68203 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01move trivial forwarding function inline.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Implement code generation of namespaces and add mangling tests.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68170 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31Change UsedArray to be a vector of WeakVH to fix a dangling pointer problem ↵Chris Lattner
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
2009-03-27Do not emit debug information for variables while generating optimized code. ↵Devang Patel
The llvm optimizer and code generator are not yet ready to support optimized code debugging. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67876 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-26most of this is plumbing to get CompileOptions down into Chris Lattner
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
2009-03-22switch getBuiltinLibFunction to use the new GetOrCreateLLVMFunction Chris Lattner
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
2009-03-22emit aliases as the definitions fly by, don't bother deferring untilChris Lattner
the end of the module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-22pull "runtime globals" into the same framework as other functions/global ↵Chris Lattner
variables. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67478 91177308-0d34-0410-b5e6-96231b3b80d8
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21fix a crash that could occur when a variable declaration became aChris Lattner
function definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21simplify and cleanup global variable creation stuff to all go through oneChris Lattner
code path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21simplify management of llvm::Function creation to all go throughChris Lattner
GetAddrOfFunction. This is simpler and more efficient. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67444 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21code cleanups, rename EmitForwardFunctionDefinition -> Chris Lattner
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
2009-03-21simplify some more code.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21simplify and comment some code better. Make BindRuntimeGlobalsChris Lattner
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
2009-03-19IRgen support for alias of global variable.Daniel Dunbar
- PR3818. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67297 91177308-0d34-0410-b5e6-96231b3b80d8
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09Be sure to never create two functions with the same name, instead arrange toMike Stump
reuse the prior one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07Some struct/class mismatch fixes, to silence MSVC warnings.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66335 91177308-0d34-0410-b5e6-96231b3b80d8
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Move more of the blocks code up and out.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66046 91177308-0d34-0410-b5e6-96231b3b80d8
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Start the migration of more of the blocks code out of sight for mostMike Stump
people. De-duplicates BLOCK_NEEDS_FREE and friends. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66034 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Improved ABI compliance for __block variables. No testcases yet as weMike Stump
still give an unsupported error for them due to the fact this is a work in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66007 91177308-0d34-0410-b5e6-96231b3b80d8
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65657 91177308-0d34-0410-b5e6-96231b3b80d8
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24Prevent accidental copying of CodeGenFunction and CodeGenModule.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65372 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19Don't emit K&R unprototyped function definitions as varargs.Daniel Dunbar
- <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