summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
Commit message (Collapse)AuthorAge
* Improve key-function computation for templates. In particular:Douglas Gregor2010-01-05
| | | | | | | | | | | | | | | | | | - All classes can have a key function; templates don't change that. non-template classes when computing the key function. - We always mark all of the virtual member functions of class template instantiations. - The vtable for an instantiation of a class template has weak linkage. We could probably use available_externally linkage for vtables of classes instantiated by explicit instantiation declarations (extern templates), but GCC doesn't do this and I'm not 100% that the ABI permits it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92753 91177308-0d34-0410-b5e6-96231b3b80d8
* Add code to skip the emission of available externally functions at -O0. WIP.Mike Stump2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92749 91177308-0d34-0410-b5e6-96231b3b80d8
* strength reduce this call away.Chris Lattner2009-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92253 91177308-0d34-0410-b5e6-96231b3b80d8
* this form of SetDebugLocation is about to go away, add some #includes thatChris Lattner2009-12-28
| | | | | | | are about to not come in implicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92228 91177308-0d34-0410-b5e6-96231b3b80d8
* Some small improvements to dead code elimination; helps a bit onEli Friedman2009-12-25
| | | | | | | | LLVM-Code-Symbols test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92152 91177308-0d34-0410-b5e6-96231b3b80d8
* Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gaveJeffrey Yasskin2009-12-12
| | | | | | | no extra safety anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR5714: make sure globals that will be modified aren't marked const.Eli Friedman2009-12-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91156 91177308-0d34-0410-b5e6-96231b3b80d8
* Random string-related cleanups.Benjamin Kramer2009-12-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91119 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that explicitly instantiated functions get the right linkage.Anders Carlsson2009-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91069 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR5709: use the computed type of the declaration instead of theEli Friedman2009-12-09
| | | | | | | | | type of the builtin when generating the function declaration for a builtin library call. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90936 91177308-0d34-0410-b5e6-96231b3b80d8
* Misc key function fixes.Eli Friedman2009-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90831 91177308-0d34-0410-b5e6-96231b3b80d8
* A bunch more thunk fixes from misc testing.Eli Friedman2009-12-07
| | | | | | | | (Yes, I do intend to commit some tests for this.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90818 91177308-0d34-0410-b5e6-96231b3b80d8
* Work-in-progess rewrite of thunks: move thunk generation outside of vtableEli Friedman2009-12-06
| | | | | | | | | generation, and make sure we generate thunks when the function is defined rather than when the vtable is defined. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90722 91177308-0d34-0410-b5e6-96231b3b80d8
* Add rudimentary support for member pointers to CGDebugInfo.Anders Carlsson2009-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90711 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't emit explicit specializations of static member variable declarations.Anders Carlsson2009-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90624 91177308-0d34-0410-b5e6-96231b3b80d8
* Have ASTRecordLayout keep track of the key function, in preparation of ↵Anders Carlsson2009-11-30
| | | | | | fixing a synthetic ctor/dtor bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90168 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to generate common globals for C++ files, instead of depending on ↵Daniel Dunbar2009-11-30
| | | | | | the FE to set NoCommon, and simplify CodeGenOptions initialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90119 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify and fix up the handling of implicit constructors, copy assignmentEli Friedman2009-11-26
| | | | | | | | | | operators, and destructors. Avoids generating declarations/definitions of trivial constructors/destructors, and makes sure the trivial copy assignment operator is generated when necessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89943 91177308-0d34-0410-b5e6-96231b3b80d8
* Use new getLinkage() method to correctly compute whether a variable hasEli Friedman2009-11-26
| | | | | | | | internal linkage. Fixes PR5433. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89931 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore constructor member templates in CodeGenModule::EmitTopLevelDecl.Anders Carlsson2009-11-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89737 91177308-0d34-0410-b5e6-96231b3b80d8
* Mangler: Lift shouldMangleDeclName predicate out of CXXNameMangler::mangle.Daniel Dunbar2009-11-21
| | | | | | | | - Sometimes we have to mangle things we wouldn't normally (e.g., because they appear in a template expression). - This also tidies up the predicate to be more obvious what is getting mangled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89555 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Switch the C++ mangler interfaces to take the SmallVector to write into,Daniel Dunbar2009-11-21
| | | | | | | instead of requiring clients to make a raw_svector_ostream, which is just an implementation detail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89548 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink free mangle* methods into MangleContext.Daniel Dunbar2009-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89547 91177308-0d34-0410-b5e6-96231b3b80d8
* Added rudimentary C++0x attribute support.Sean Hunt2009-11-21
| | | | | | | | | | | | | | | The following attributes are currently supported in C++0x attribute lists (and in GNU ones as well): - align() - semantics believed to be conformant to n3000, except for redeclarations and what entities it may apply to - final - semantics believed to be conformant to CWG issue 817's proposed wording, except for redeclarations - noreturn - semantics believed to be conformant to n3000, except for redeclarations - carries_dependency - currently ignored (this is an optimization hint) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89543 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixup key function calculations.Mike Stump2009-11-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89412 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve instantiation control for rtti data and allow key functions toMike Stump2009-11-19
| | | | | | | instantiate a class. WIP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89289 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip over shadow using decls during codegen.John McCall2009-11-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89079 91177308-0d34-0410-b5e6-96231b3b80d8
* The ssp and sspreq function attributes should only be applied to function ↵Anders Carlsson2009-11-16
| | | | | | definitions, not declarations or calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88915 91177308-0d34-0410-b5e6-96231b3b80d8
* Make GetAddrOfConstantStringFromLiteral return a constant of the correct type.Eli Friedman2009-11-16
| | | | | | | | | This doesn't have any visible effects at the moment because normally the implicit cast code forces the type to the expected type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88896 91177308-0d34-0410-b5e6-96231b3b80d8
* Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.Chandler Carruth2009-11-12
| | | | | | | This resolves the layering violation where CodeGen depended on Frontend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86998 91177308-0d34-0410-b5e6-96231b3b80d8
* Rearrange function to avoid recursive use-after-free.Eli Friedman2009-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86516 91177308-0d34-0410-b5e6-96231b3b80d8
* add missing #includeChris Lattner2009-11-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86368 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for static variables which requireFariborz Jahanian2009-11-05
| | | | | | | | initialization before main. Fixes pr5396. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86145 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement proper linkage for explicit instantiation declarations ofDouglas Gregor2009-10-27
| | | | | | | | | | | | | | | | | | | | | | | inlined functions. For example, given template<typename T> class string { unsigned Len; public: unsigned size() const { return Len; } }; extern template class string<char>; we now give the instantiation of string<char>::size available_externally linkage (if it is ever instantiated!), as permitted by the C++0x standard. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85340 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce FunctionDecl::isInlined() to tell whether a function shouldDouglas Gregor2009-10-27
| | | | | | | be inlined. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85307 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename FunctionDecl::isInline/setInline toDouglas Gregor2009-10-27
| | | | | | | FunctionDecl::isInlineSpecified/setInlineSpecified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a PrettyStackTraceDecl in CodeGenModule::EmitGlobalDefinition.Anders Carlsson2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85237 91177308-0d34-0410-b5e6-96231b3b80d8
* assert -> llvm_unreachableDouglas Gregor2009-10-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85125 91177308-0d34-0410-b5e6-96231b3b80d8
* Move clients to use IdentifierInfo::getNameStart() instead of getName()Daniel Dunbar2009-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84436 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a thinko that John pointed outDouglas Gregor2009-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84142 91177308-0d34-0410-b5e6-96231b3b80d8
* Give explicit and implicit instantiations of static data members ofDouglas Gregor2009-10-14
| | | | | | | | | class templates the proper linkage. Daniel, please look over the CodeGenModule bits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84140 91177308-0d34-0410-b5e6-96231b3b80d8
* Copy metadata associated with CIDevang Patel2009-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84114 91177308-0d34-0410-b5e6-96231b3b80d8
* fix some cfstring related issues: Chris Lattner2009-10-14
| | | | | | | | | | | | | | | 1) -fwritable-string does affect the non-utf16 version of cfstrings just not the utf16 ones. 2) utf16 strings should always be marked constant, as the __TEXT segment is readonly. 3) The name of the global doesn't matter, remove it from TargetInfo. 4) Trust the asmprinter to drop cstrings into the right section, like llvmgcc does now. This fixes rdar://7115750 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84077 91177308-0d34-0410-b5e6-96231b3b80d8
* unbreak test/CodeGen/builtins.c, reverting Devang's change.Chris Lattner2009-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84075 91177308-0d34-0410-b5e6-96231b3b80d8
* Check void type before using replaceAllUsesWith().Devang Patel2009-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84050 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove extra white space line.Devang Patel2009-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83979 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not check use_empty() before invoking replaceAllUsesWith().Devang Patel2009-10-13
| | | | | | | | Let replaceAllUsesWith() adjust VHs even though there are no uses. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83978 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify pointer creation with the new Type::getInt*Ptr methods.Benjamin Kramer2009-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83964 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the vtable builder to CGVtable.cpp, general cleanup.Anders Carlsson2009-10-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83798 91177308-0d34-0410-b5e6-96231b3b80d8
* If a global initializer has a non-trivial constructor or destructor, we ↵Anders Carlsson2009-10-08
| | | | | | | | | | | | | | | | | | | | | never want to defer generation of it, even if it is declared static. With this change we're finally able to compile and run the (infamous) #include <string> #include <iostream> int main(int argc, char **argv) { std::cout << "Hello, World" << std::endl; } $ clang hello.cpp -lstdc++ -o hello $ ./hello Hello, World git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83559 91177308-0d34-0410-b5e6-96231b3b80d8