summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* When given the magic class __cxxabiv1::__fundamental_type_info, produceRafael Espindola2010-03-271-0/+1
| | | | | | | | the typeinfo for the fundamental types. Fixes PR6685. llvm-svn: 99701
* revert 99311. Looks like it broke darwin bootstrap.Rafael Espindola2010-03-231-11/+2
| | | | llvm-svn: 99317
* Avoid producing implicit methods when we have a explicit template instantiationRafael Espindola2010-03-231-2/+11
| | | | | | declaration. llvm-svn: 99311
* Always emit associated thunks when emitting the function itself. Remove ↵Anders Carlsson2010-03-231-15/+4
| | | | | | getVtableAddressPoint, it's not used. llvm-svn: 99252
* Rename MaybeEmitVtable to EmitVTableRelatedData in preparation for making it ↵Anders Carlsson2010-03-231-1/+1
| | | | | | emit thunks as well. llvm-svn: 99251
* Rename CGVtableInfo to CodeGenVTables in preparation of adding another ↵Anders Carlsson2010-03-231-3/+3
| | | | | | VTableInfo class. llvm-svn: 99250
* C++: Add support for -fno-use-cxa-atexit.Daniel Dunbar2010-03-201-0/+1
| | | | | | | | - So much typing, so little gain... Also, rename the __cxx_global_initialization function just to match llvm-gcc. llvm-svn: 99039
* Change CodeGenModule to rely on the Module's symbol table instead ofJohn McCall2010-03-191-86/+72
| | | | | | | | | | | | | shadowing it in the GlobalDeclMap. Eliminates the string-uniquing requirement for mangled names, which should help C++ codegen times a little. Forces us to do string lookups instead of pointer lookups, which might hurt codegen times a little across the board. We'll see how it plays out. Removing the string-uniquing requirement implicitly fixes any bugs like PR6635 which arose from the fact that we had multiple uniquing tables for different kinds of identifiers. llvm-svn: 99012
* Give explicit template instantiations weak ODR linkage. FormerDouglas Gregor2010-03-131-7/+16
| | | | | | | | | iterations of this patch gave explicit template instantiation link-once ODR linkage, which permitted the back end to eliminate unused symbols. Weak ODR linkage still requires the symbols to be generated. llvm-svn: 98441
* Re-revert the explicit template instantiation linkage patch. I am beginning ↵Douglas Gregor2010-03-131-10/+8
| | | | | | to look incompetent llvm-svn: 98425
* Reinstate patch to turn explicit template instantiations into weak symbolsDouglas Gregor2010-03-131-8/+10
| | | | llvm-svn: 98424
* Revert the linkage change for explicit template instantiations; something is ↵Douglas Gregor2010-03-121-10/+8
| | | | | | amiss llvm-svn: 98332
* Give explicit template instantiations weak linkage (but don't deferDouglas Gregor2010-03-121-8/+10
| | | | | | them). Fixes PR6578. llvm-svn: 98328
* Delay codegen of vtables when handling implicit instantiations.Rafael Espindola2010-03-101-1/+9
| | | | | | This fixes PR6474. llvm-svn: 98123
* Add a message to these asserts.Benjamin Kramer2010-03-061-3/+3
| | | | llvm-svn: 97873
* Implement __builtin_dwarf_sp_column for i386 (Darwin and not), x86-64 (all),John McCall2010-03-061-0/+5
| | | | | | | and ARM. Implement __builtin_init_dwarf_reg_size_table for i386 (both) and x86-64 (all). llvm-svn: 97859
* Fix PR6473.Rafael Espindola2010-03-041-0/+47
| | | | | | | | | Clang's support for weakref is now better than llvm-gcc's :-) We don't introduce a new symbol and we correctly mark undefined references weak only if there is no definition or regular undefined references in the same file. llvm-svn: 97733
* Revert changes r97693, r97700, and r97718.John McCall2010-03-041-4/+3
| | | | | | Our testing framework can't deal with disabled targets yet. llvm-svn: 97719
* Refactor local class name mangling and make itFariborz Jahanian2010-03-041-1/+1
| | | | | | ABI conforming. llvm-svn: 97702
* Create a TargetMachine whenever we create a CodeGenAction. The codegen ofJohn McCall2010-03-041-3/+4
| | | | | | some builtins will rely on target knowledge. llvm-svn: 97693
* During codegen assert that any copy assignment, destructor or constructor thatRafael Espindola2010-03-021-3/+9
| | | | | | | | we need to synthesize has been marked as used by Sema. Change Sema to avoid these asserts. llvm-svn: 97589
* Add support for the weakref attribute. We still produce "alias weak" as ↵Rafael Espindola2010-02-231-0/+1
| | | | | | llvm-gcc does, but are more strict on what uses of weakref we accept. llvm-svn: 96992
* Perform two more constructor/destructor code-size optimizations:John McCall2010-02-231-21/+1
| | | | | | | | | | | | | | | | 1) emit base destructors as aliases to their unique base class destructors under some careful conditions. This is enabled for the same targets that can support complete-to-base aliases, i.e. not darwin. 2) Emit non-variadic complete constructors for classes with no virtual bases as calls to the base constructor. This is enabled on all targets and in theory can trigger in situations that the alias optimization can't (mostly involving virtual bases, mostly not yet supported). These are bundled together because I didn't think it worthwhile to split them, not because they really need to be. llvm-svn: 96842
* Re-introduce the ctor/dtor alias optimization, this time hidden behind aJohn McCall2010-02-191-12/+17
| | | | | | command-line option which defaults off. llvm-svn: 96649
* Revert the ctor/dtor alias optimization for now; the buildbots can detectJohn McCall2010-02-181-17/+12
| | | | | | some failure here that I can't. llvm-svn: 96612
* Emit complete constructors and destructors as aliases to base constructorsJohn McCall2010-02-171-12/+17
| | | | | | | | and destructors when the two entities are semantically identical, i.e. when the class has no virtual base classes. We only do this for linkage types for which aliases are supported, i.e. internal and external, i.e. not linkonce. llvm-svn: 96451
* Remove use of 'std::string' from Attr objects, using instead a byteTed Kremenek2010-02-111-2/+2
| | | | | | | | | array allocated using the allocator in ASTContext. This addresses these strings getting leaked when using a BumpPtrAllocator (in ASTContext). Fixes: <rdar://problem/7636765> llvm-svn: 95853
* Emit global references with constant initializers as constants. Fixes PR5585.John McCall2010-02-081-1/+1
| | | | | | | The standard actually says that such references should have internal linkage, but gcc doesn't do that, so we probably can't get away with it. llvm-svn: 95577
* Improved handling of the visibility attribute. Declarations now inherit ↵Anders Carlsson2010-02-071-0/+4
| | | | | | | | their parent's visibility. (This is kind of a risky change, but I did a self-host build and everything appears to work fine!) llvm-svn: 95511
* Switch CodeGen's "is this variable declaration a definition?" logicDouglas Gregor2010-02-061-14/+1
| | | | | | | | | over to VarDecl::isThisDeclarationADefinition(), which handles variables declared with linkage specifications better (among other things). CMake 2.9 (from CVS) now builds with clang++ and is somewhat functional. llvm-svn: 95486
* Use the correct function info for constructors when applying function ↵Anders Carlsson2010-02-061-4/+5
| | | | | | attributes. Fixes PR6245. llvm-svn: 95474
* When a function or variable somehow depends on a type or declarationDouglas Gregor2010-02-031-31/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that is in an anonymous namespace, give that function or variable internal linkage. This change models an oddity of the C++ standard, where names declared in an anonymous namespace have external linkage but, because anonymous namespace are really "uniquely-named" namespaces, the names cannot be referenced from other translation units. That means that they have external linkage for semantic analysis, but the only sensible implementation for code generation is to give them internal linkage. We now model this notion via the UniqueExternalLinkage linkage type. There are several changes here: - Extended NamedDecl::getLinkage() to produce UniqueExternalLinkage when the declaration is in an anonymous namespace. - Added Type::getLinkage() to determine the linkage of a type, which is defined as the minimum linkage of the types (when we're dealing with a compound type that is not a struct/class/union). - Extended NamedDecl::getLinkage() to consider the linkage of the template arguments and template parameters of function template specializations and class template specializations. - Taught code generation to rely on NamedDecl::getLinkage() when determining the linkage of variables and functions, also considering the linkage of the types of those variables and functions (C++ only). Map UniqueExternalLinkage to internal linkage, taking out the explicit checks for isInAnonymousNamespace(). This fixes much of PR5792, which, as discovered by Anders Carlsson, is actually the reason behind the pass-manager assertion that causes the majority of clang-on-clang regression test failures. With this fix, Clang-built-Clang+LLVM passes 88% of its regression tests (up from 67%). The specific numbers are: LLVM: Expected Passes : 4006 Expected Failures : 32 Unsupported Tests : 40 Unexpected Failures: 736 Clang: Expected Passes : 1903 Expected Failures : 14 Unexpected Failures: 75 Overall: Expected Passes : 5909 Expected Failures : 46 Unsupported Tests : 40 Unexpected Failures: 811 Still to do: - Improve testing - Check whether we should allow the presence of types with InternalLinkage (in addition to UniqueExternalLinkage) given variables/functions internal linkage in C++, as mentioned in PR5792. - Determine how expensive the getLinkage() calls are in practice; consider caching the result in NamedDecl. - Assess the feasibility of Chris's idea in comment #1 of PR5792. llvm-svn: 95216
* Don't explicitly force utf strings into the __TEXT,__ustringChris Lattner2010-02-011-4/+0
| | | | | | | | | | by setting the section of the generated global. This is an optimization done by the code generator, and the code being removed didn't handle the case when the string contained an embedded nul (which the code generator does correctly handle). This is rdar://7589850 llvm-svn: 95003
* In C++, an initializer on a variable doesn't necessarily mean it's the ↵Sebastian Redl2010-02-011-1/+1
| | | | | | definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function. llvm-svn: 94999
* Change the return type of ASTContext::getDeclAlignInBytes() to CharUnits and,Ken Dyck2010-01-271-1/+1
| | | | | | | now that the "InBytes" part of the name is implied by the return type, rename it to getDeclAlign(). llvm-svn: 94681
* Use CharUnits for alignment of UTF16 string in GetAddrOfConstantCFString().Ken Dyck2010-01-261-2/+2
| | | | llvm-svn: 94564
* Use the right definition when emitting a global variable. Fixes PR5564.Anders Carlsson2010-01-261-3/+5
| | | | llvm-svn: 94555
* Introduce CodeGenModule::GetTargetTypeStoreSize() to calculate the store sizeKen Dyck2010-01-261-0/+6
| | | | | | of LLVM types in character units. llvm-svn: 94542
* If a global variable has an initializer with side effects, it can never be ↵Anders Carlsson2010-01-261-3/+2
| | | | | | deferred (even if it's in an anonymous namespace). llvm-svn: 94525
* Created __builtin___NSStringMakeConstantString() builtin, which generates ↵David Chisnall2010-01-231-0/+9
| | | | | | constant Objective-C strings. llvm-svn: 94274
* Generalize target weirdness handling having proper layering in mind:Anton Korobeynikov2010-01-101-2/+6
| | | | | | | | | 1. Add helper class for sema checks for target attributes 2. Add helper class for codegen of target attributes As a proof-of-concept - implement msp430's 'interrupt' attribute. llvm-svn: 93118
* revert r92749, which is just dead code.Chris Lattner2010-01-091-10/+0
| | | | llvm-svn: 93074
* Fix for PR5967: Make const-marking for LLVM globals correct for cases requiringEli Friedman2010-01-081-5/+5
| | | | | | | run-time initialization, and emit run-time initializers aggresively to avoid ordering issues with deferred globals. llvm-svn: 92976
* Fix linkage for RTTI names by re-using the logic for computing theDouglas Gregor2010-01-061-24/+21
| | | | | | | | linkage of vtables. Before this, we were emitting RTTI names for template instantiations with strong external linkage rather than with weak ODR linkage. llvm-svn: 92857
* Fix marking of virtual members for nested classes whose first non-pure ↵Douglas Gregor2010-01-061-0/+54
| | | | | | virtual function has a body inlined in the class llvm-svn: 92855
* Improve key-function computation for templates. In particular:Douglas Gregor2010-01-051-1/+2
| | | | | | | | | | | | | | | | - 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. llvm-svn: 92753
* Add code to skip the emission of available externally functions at -O0. WIP.Mike Stump2010-01-051-0/+10
| | | | llvm-svn: 92749
* strength reduce this call away.Chris Lattner2009-12-291-1/+2
| | | | llvm-svn: 92253
* this form of SetDebugLocation is about to go away, add some #includes thatChris Lattner2009-12-281-3/+2
| | | | | | are about to not come in implicitly. llvm-svn: 92228
* Some small improvements to dead code elimination; helps a bit onEli Friedman2009-12-251-1/+1
| | | | | | LLVM-Code-Symbols test. llvm-svn: 92152
OpenPOWER on IntegriCloud