aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
AgeCommit message (Collapse)Author
2009-11-30Have ASTRecordLayout keep track of the key function, in preparation of ↵Anders Carlsson
fixing a synthetic ctor/dtor bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90168 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30Don't try to generate common globals for C++ files, instead of depending on ↵Daniel Dunbar
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
2009-11-26Simplify and fix up the handling of implicit constructors, copy assignmentEli Friedman
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
2009-11-26Use new getLinkage() method to correctly compute whether a variable hasEli Friedman
internal linkage. Fixes PR5433. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-24Ignore constructor member templates in CodeGenModule::EmitTopLevelDecl.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89737 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21Mangler: Lift shouldMangleDeclName predicate out of CXXNameMangler::mangle.Daniel Dunbar
- 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
2009-11-21IRgen: Switch the C++ mangler interfaces to take the SmallVector to write into,Daniel Dunbar
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
2009-11-21Sink free mangle* methods into MangleContext.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21Added rudimentary C++0x attribute support.Sean Hunt
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
2009-11-20Fixup key function calculations.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19Improve instantiation control for rtti data and allow key functions toMike Stump
instantiate a class. WIP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89289 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17Skip over shadow using decls during codegen.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16The ssp and sspreq function attributes should only be applied to function ↵Anders Carlsson
definitions, not declarations or calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16Make GetAddrOfConstantStringFromLiteral return a constant of the correct type.Eli Friedman
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
2009-11-12Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.Chandler Carruth
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
2009-11-09Rearrange function to avoid recursive use-after-free.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07add missing #includeChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05Added support for static variables which requireFariborz Jahanian
initialization before main. Fixes pr5396. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27Implement proper linkage for explicit instantiation declarations ofDouglas Gregor
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
2009-10-27Introduce FunctionDecl::isInlined() to tell whether a function shouldDouglas Gregor
be inlined. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27Rename FunctionDecl::isInline/setInline toDouglas Gregor
FunctionDecl::isInlineSpecified/setInlineSpecified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27Add a PrettyStackTraceDecl in CodeGenModule::EmitGlobalDefinition.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26assert -> llvm_unreachableDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18Move clients to use IdentifierInfo::getNameStart() instead of getName()Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14Fix a thinko that John pointed outDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14Give explicit and implicit instantiations of static data members ofDouglas Gregor
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
2009-10-14Copy metadata associated with CIDevang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14fix some cfstring related issues: Chris Lattner
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
2009-10-14unbreak test/CodeGen/builtins.c, reverting Devang's change.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84075 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13Check void type before using replaceAllUsesWith().Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84050 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13Remove extra white space line.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13Do not check use_empty() before invoking replaceAllUsesWith().Devang Patel
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
2009-10-13Simplify pointer creation with the new Type::getInt*Ptr methods.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11Move the vtable builder to CGVtable.cpp, general cleanup.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08If a global initializer has a non-trivial constructor or destructor, we ↵Anders Carlsson
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
2009-10-07Add a MangleContext and pass it to all mangle functions. It will be used for ↵Anders Carlsson
keeping state, such as identifiers assigned to anonymous structs as well as scope encoding. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05Fix thinko and simplify.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05Ensure we have atleast 2-byte alignment for member functions.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05Respect alignments better.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05Use new predicates for some type equality tests.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83303 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01Anonymous namespaces, sema + codegen. A lot of semantics are still broken,John McCall
apparently because using directives aren't quite working correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23Handle namespace aliases.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82644 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22Revert "Switch a few clients over to StringLiteral::getString.", this is ↵Daniel Dunbar
breaking some projects, but I don't have a test case yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22Switch a few clients over to StringLiteral::getString.Daniel Dunbar
- Switching all of them out-of-my-current-scope-of-interest, sorry. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall
Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14Fix subtle bug in generating LLVM function declarations for builtin functions.Daniel Dunbar
The decl wasn't being passed down, which meant that function attributes were not being set correctly. This is particularly important for ARM, since it wants to override the calling convention. Instead we would emit the builtin with the wrong calling convention, and instcombine would come along and merrily shred all the calls to it. :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13Rework the way we determine whether an externally visible symbol isDouglas Gregor
generated for an inline function definition, taking into account C99 and GNU inline/extern inline semantics. This solution is simpler, cleaner, and fixes PR4536. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12Change CodeGenModule::ConstructTypeAttributes to return the calling conventionDaniel Dunbar
to use, and allow the ABI implementation to override the calling convention. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81593 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12Remove unnecessary ASTContext parameters from isMain and isExternCDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81589 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11Set the calling convention based on the CGFunctionInfo.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81582 91177308-0d34-0410-b5e6-96231b3b80d8