summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
AgeCommit message (Collapse)Author
2009-07-14Update for LLVM API change, and contextify a bunch of related stuff.Owen Anderson
llvm-svn: 75705
2009-07-14Revert 75648 for now. It is causing test failures.Devang Patel
llvm-svn: 75684
2009-07-14Use LLVM mangler to get mangled name for debug info entry.Devang Patel
llvm-svn: 75589
2009-07-13Update for LLVM API change.Owen Anderson
llvm-svn: 75446
2009-07-08Update for LLVM API change.Owen Anderson
llvm-svn: 75028
2009-07-08Update for LLVM API change.Owen Anderson
llvm-svn: 74986
2009-06-30De-ASTContext-ify DeclContext.Argyrios Kyrtzidis
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. llvm-svn: 74506
2009-06-30Remove the ASTContext parameter from the getBody() methods of Decl and ↵Argyrios Kyrtzidis
subclasses. Timings showed no significant difference before and after the commit. llvm-svn: 74504
2009-06-30Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
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. llvm-svn: 74466
2009-06-29Keep track of function template specializations, to eliminateDouglas Gregor
redundant, implicit instantiations of function templates and provide a place where we can hang function template specializations. llvm-svn: 74454
2009-06-29Move FunctionDecl::TemplateSpecializationInfo out into its own class,Douglas Gregor
FunctionTemplateSpecializationInfo, in DeclTemplate.h. No functionality change. llvm-svn: 74431
2009-06-23Patch fixes an obscure bug when 'used' attribute is applied toFariborz Jahanian
variables in ObjC's Next runtime mode. Next runtime also implicitly applies 'used' attribute on some of its meta-data. This results in two 'llvm.used' arrays to be generated, and one of them is renamed to 'llvm.used1'. llvm-svn: 74008
2009-06-20Parsing and AST support for using declarations, from John Thompson!Douglas Gregor
llvm-svn: 73812
2009-06-18Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor
llvm-svn: 73702
2009-06-17Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.Argyrios Kyrtzidis
llvm-svn: 73651
2009-06-14Sink the BuiltinInfo object from ASTContext into theChris Lattner
preprocessor and initialize it early in clang-cc. This ensures that __has_builtin works in all modes, not just when ASTContext is around. llvm-svn: 73319
2009-06-14move GetBuiltinType from Builtin::Context to ASTContext.Chris Lattner
llvm-svn: 73316
2009-06-11Don't assert when generating code with static_asserts.Anders Carlsson
llvm-svn: 73208
2009-06-05weak_import should not make definitions have weak linkage.Daniel Dunbar
- <rdar://problem/6948703> clang treats weak_import like weak llvm-svn: 72967
2009-06-04Make ReplaceUsesOfNonProtoTypeWithRealFunction verify that a call is *to* theChris Lattner
function of interest, not an operand of it. llvm-svn: 72869
2009-05-29Add code for emitting C++ destructors. Not used yet.Anders Carlsson
llvm-svn: 72591
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. llvm-svn: 72408
2009-05-16extern "C" should preserve the 'extern' qualifier for VarDecls. Fixes 6853728.Anders Carlsson
llvm-svn: 71957
2009-05-16Reflow some comments.Mike Stump
llvm-svn: 71937
2009-05-15A C++ member function always has either weak linkage (if it's inline or ↵Anders Carlsson
defined inline) or strong linkage (other cases). llvm-svn: 71873
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. llvm-svn: 71594
2009-05-12add an initial stab at emitting deferred c++ inline functions. This handles ↵Chris Lattner
static functions and methods declared inline, but not ctors/dtors or methods not declared inline (apparently my previous patch wasn't good enough). llvm-svn: 71591
2009-05-12cleanups, no functionality change.Chris Lattner
llvm-svn: 71590
2009-05-12revert my previous patch, I committed the wrong file.Chris Lattner
llvm-svn: 71585
2009-05-12static methods don't get this pointers.Chris Lattner
llvm-svn: 71583
2009-05-05When defining a function whose type has no prototype, make an effortChris Lattner
to go back and clean up existing uses of the bitcasted function. This is not just an optimization: it is required for correctness to get always inline functions to work, see testcases in function-attributes.c. llvm-svn: 70971
2009-05-05Refactor global decls to hold either a regular Decl or a CXXConstructorDecl ↵Anders Carlsson
+ ctor type or a CXXDestructorDecl + dtor type. llvm-svn: 70962
2009-05-03Fix comment to account for r70786.Eli Friedman
llvm-svn: 70789
2009-05-03PR4133: fix always_inline implementation to be consistent with gcc.Eli Friedman
llvm-svn: 70786
2009-04-28Improve compatibility with GCC regarding inline semantics in GNU89Douglas Gregor
mode and in the presence of __gnu_inline__ attributes. This should fix both PR3989 and PR4069. As part of this, we now keep track of all of the attributes attached to each declaration even after we've performed declaration merging. This fixes PR3264. llvm-svn: 70292
2009-04-23Fix handling of C99 "extern inline" semantics when dealing withDouglas Gregor
multiple declarations of the function. Should fix PR3989 and <rdar://problem/6818429>. llvm-svn: 69905
2009-04-23Eliminate the three SmallVectors in ObjCImplDecl (for instanceDouglas Gregor
methods, class methods, and property implementations) and instead place all of these entities into the DeclContext. This eliminates more linear walks when looking for class or instance methods and should make PCH (de-)serialization of ObjCDecls trivial (and lazy). llvm-svn: 69849
2009-04-22Don't convert interface types (to structs) as part of CodeGenTypes.Daniel Dunbar
- This has pros and cons, but for now the pros seem to significantly outway the con. The con is that we will always need to cast in the runtime implementation to a struct type, if we wish to access an interface directly. The pros are: - Avoid the cost of generating types which are used. Most manipulation of Objective-C objects is done through messages, and only the implementation of a class will directly access memory. Previously, we would convert the type even if it only appear as a function parameter, for example. - We don't need to worry about incomplete types, and UpdateCompletedType for interfaces is gone. - It becomes easier to narrow the interface to the shadow struct for Objective-C interfaces (so it can be eliminated). Currently the runtimes still use the CodeGenTypes machinery to generate the LLVM structure they need via ConvertTagDecl, but this can eventually be replaced. llvm-svn: 69797
2009-04-22Fix some mishandling of the attr(gnu_inline) mode when used withChris Lattner
extern. Previously we would warn about it and ignore the attribute. This is incorrect, it should be handled as a c89 "extern inline" function. Many thanks to Matthieu Castet for pointing this out and beating me over the head until I got it. PR3988: extern inline function are not externally visible llvm-svn: 69756
2009-04-21Fix emission of static tentative definitions referenced from other static ↵Douglas Gregor
functions llvm-svn: 69699
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. llvm-svn: 69681
2009-04-20the __gnuc_inline__ attribute is actually named __gnu_inline__,Chris Lattner
PR4023 llvm-svn: 69618
2009-04-19PR3853: Add CodeGen support for __thread.Eli Friedman
llvm-svn: 69545
2009-04-19silence a warning, it isn't clear what the right answer is here,Chris Lattner
will talk to steve. llvm-svn: 69519
2009-04-18FunctionDecl::getBody() is getting an ASTContext argument for use inDouglas Gregor
lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. llvm-svn: 69406
2009-04-17Add support for generating (very basic) C++ destructors. These aren't called ↵Anders Carlsson
by anything yet. llvm-svn: 69343
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 llvm-svn: 69337
2009-04-16Ensure that the most recent declaration of a tentative definition winsDaniel Dunbar
when generating a common definition. llvm-svn: 69287
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. llvm-svn: 69231