aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
AgeCommit message (Collapse)AuthorFilesLines
2009-11-09Rearrange function to avoid recursive use-after-free.Eli Friedman1-17/+18
llvm-svn: 86516
2009-11-07add missing #includeChris Lattner1-0/+1
llvm-svn: 86368
2009-11-05Added support for static variables which requireFariborz Jahanian1-4/+9
initialization before main. Fixes pr5396. llvm-svn: 86145
2009-10-27Implement proper linkage for explicit instantiation declarations ofDouglas Gregor1-14/+14
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. llvm-svn: 85340
2009-10-27Introduce FunctionDecl::isInlined() to tell whether a function shouldDouglas Gregor1-2/+2
be inlined. llvm-svn: 85307
2009-10-27Rename FunctionDecl::isInline/setInline toDouglas Gregor1-2/+2
FunctionDecl::isInlineSpecified/setInlineSpecified. llvm-svn: 85305
2009-10-27Add a PrettyStackTraceDecl in CodeGenModule::EmitGlobalDefinition.Anders Carlsson1-0/+4
llvm-svn: 85237
2009-10-26assert -> llvm_unreachableDouglas Gregor1-1/+1
llvm-svn: 85125
2009-10-18Move clients to use IdentifierInfo::getNameStart() instead of getName()Daniel Dunbar1-4/+4
llvm-svn: 84436
2009-10-14Fix a thinko that John pointed outDouglas Gregor1-3/+1
llvm-svn: 84142
2009-10-14Give explicit and implicit instantiations of static data members ofDouglas Gregor1-3/+42
class templates the proper linkage. Daniel, please look over the CodeGenModule bits. llvm-svn: 84140
2009-10-14Copy metadata associated with CIDevang Patel1-0/+4
llvm-svn: 84114
2009-10-14fix some cfstring related issues: Chris Lattner1-13/+10
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 llvm-svn: 84077
2009-10-14unbreak test/CodeGen/builtins.c, reverting Devang's change.Chris Lattner1-2/+2
llvm-svn: 84075
2009-10-13Check void type before using replaceAllUsesWith().Devang Patel1-1/+2
llvm-svn: 84050
2009-10-13Remove extra white space line.Devang Patel1-1/+0
llvm-svn: 83979
2009-10-13Do not check use_empty() before invoking replaceAllUsesWith().Devang Patel1-2/+3
Let replaceAllUsesWith() adjust VHs even though there are no uses. llvm-svn: 83978
2009-10-13Simplify pointer creation with the new Type::getInt*Ptr methods.Benjamin Kramer1-4/+2
llvm-svn: 83964
2009-10-11Move the vtable builder to CGVtable.cpp, general cleanup.Anders Carlsson1-1/+2
llvm-svn: 83798
2009-10-08If a global initializer has a non-trivial constructor or destructor, we ↵Anders Carlsson1-0/+11
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 llvm-svn: 83559
2009-10-07Add a MangleContext and pass it to all mangle functions. It will be used for ↵Anders Carlsson1-2/+2
keeping state, such as identifiers assigned to anonymous structs as well as scope encoding. llvm-svn: 83442
2009-10-05Fix thinko and simplify.Mike Stump1-2/+2
llvm-svn: 83342
2009-10-05Ensure we have atleast 2-byte alignment for member functions.Mike Stump1-0/+3
llvm-svn: 83337
2009-10-05Respect alignments better.Mike Stump1-0/+3
llvm-svn: 83328
2009-10-05Use new predicates for some type equality tests.Benjamin Kramer1-1/+1
llvm-svn: 83303
2009-10-01Anonymous namespaces, sema + codegen. A lot of semantics are still broken,John McCall1-1/+8
apparently because using directives aren't quite working correctly. llvm-svn: 83184
2009-09-23Handle namespace aliases.Anders Carlsson1-0/+1
llvm-svn: 82644
2009-09-22Revert "Switch a few clients over to StringLiteral::getString.", this is ↵Daniel Dunbar1-5/+10
breaking some projects, but I don't have a test case yet. llvm-svn: 82539
2009-09-22Switch a few clients over to StringLiteral::getString.Daniel Dunbar1-10/+5
- Switching all of them out-of-my-current-scope-of-interest, sorry. llvm-svn: 82515
2009-09-21Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall1-1/+1
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. llvm-svn: 82501
2009-09-14Fix subtle bug in generating LLVM function declarations for builtin functions.Daniel Dunbar1-3/+3
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. :) llvm-svn: 81756
2009-09-13Rework the way we determine whether an externally visible symbol isDouglas Gregor1-25/+10
generated for an inline function definition, taking into account C99 and GNU inline/extern inline semantics. This solution is simpler, cleaner, and fixes PR4536. llvm-svn: 81670
2009-09-12Change CodeGenModule::ConstructTypeAttributes to return the calling conventionDaniel Dunbar1-8/+5
to use, and allow the ABI implementation to override the calling convention. llvm-svn: 81593
2009-09-12Remove unnecessary ASTContext parameters from isMain and isExternCDouglas Gregor1-1/+1
llvm-svn: 81589
2009-09-11Set the calling convention based on the CGFunctionInfo.Daniel Dunbar1-6/+3
llvm-svn: 81582
2009-09-10GlobalDecl doesn't have an explicit constructor anymore.Anders Carlsson1-6/+7
llvm-svn: 81481
2009-09-10Add stricter GlobalDecl constructors.Anders Carlsson1-5/+5
llvm-svn: 81480
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump1-167/+167
llvm-svn: 81346
2009-09-04Improve the AST representation and semantic analysis for externDouglas Gregor1-3/+2
templates. We now distinguish between an explicit instantiation declaration and an explicit instantiation definition, and know not to instantiate explicit instantiation declarations. Unfortunately, there is some remaining confusion w.r.t. instantiation of out-of-line member function definitions that causes trouble here. llvm-svn: 81053
2009-09-04Don't generate any code for an explicit call to a trivial destructor. Douglas Gregor1-1/+1
Now that parsing, semantic analysis, and (I think) code generation of pseudo-destructor expressions and explicit destructor calls works, update the example-dynarray.cpp test to destroy the objects it allocates and update the test to actually compile + link. The code seems correct, but the Clang-compiled version dies with a malloc error. Time to debug! llvm-svn: 81025
2009-09-02Don't try to CodeGen using directives, from Anders JohnsenDouglas Gregor1-0/+1
llvm-svn: 80853
2009-08-26Regularize the case and sort.Mike Stump1-1/+1
llvm-svn: 80163
2009-08-25Emit conversion functions correctly.Anders Carlsson1-0/+1
llvm-svn: 79985
2009-08-16Patch toward synthesizing non-trivial destructors. WIPFariborz Jahanian1-0/+38
llvm-svn: 79199
2009-08-16No need to append extra padding now that we don't create packed structs for ↵Anders Carlsson1-50/+8
simple cases like the constant string. llvm-svn: 79178
2009-08-14Fixed a bug in ir-gen for copy assignment synthesis.Fariborz Jahanian1-2/+6
Fixed a bug when evaluating those copy-assignments which need by lazily syntheized. A test case for these. llvm-svn: 78965
2009-08-13Update for LLVM API change.Owen Anderson1-17/+23
llvm-svn: 78946
2009-08-13Patch to force synthesis of copy assignment operatorFariborz Jahanian1-5/+42
function in the order according to c++03. ir-gen for copy assignment in the trivial case and the first test case. llvm-svn: 78938
2009-08-12Patch for synthesizing copy assignment operator.Fariborz Jahanian1-0/+5
WIP. llvm-svn: 78841
2009-08-11ir-gen support for anonymous union data memberFariborz Jahanian1-3/+3
copying in copy constructors and used in default constructor's initializer list. llvm-svn: 78700