summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement support for member pointers under the Microsoft C++ ABI in theCharles Davis2010-08-161-2/+2
| | | | | | | | AST library. This also adds infrastructure for supporting multiple C++ ABIs in the AST. llvm-svn: 111117
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-1/+2
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
* Emit standard-library RTTI with external linkage, not weak_odr.John McCall2010-08-041-0/+5
| | | | | | | | | | Apply hidden visibility to most RTTI; libstdc++ does not rely on exact pointer equality for the type info (just the type info names). Apply the same optimization to RTTI that we do to vtables. Fixes PR5962. llvm-svn: 110192
* Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis2010-07-291-9/+0
| | | | | | | | | | | | | | | CodeGenModule::MayDeferGeneration into a new function, DeclIsRequiredFunctionOrFileScopedVar. This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes. Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext, thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen. This fixes current (and avoids future) codegen-from-PCH bugs. llvm-svn: 109784
* cave in to reality and make ABIInfo depend on CodeGenTypes.Chris Lattner2010-07-291-1/+1
| | | | | | This will simplify a bunch of code, coming up next. llvm-svn: 109722
* IRgen: Support user defined attributes on block runtime functions.Daniel Dunbar2010-07-161-0/+5
| | | | | | | | | | | | | | | | | | - This issue here is that /usr/include/Blocks.h wants to define some of the block runtime globals as weak, depending on the target. This doesn't work in Clang because we aren't using the AST decl for these globals. - The fix is a pretty gross hack which just watches all the decls for the specific blocks globals we need to know about; if we see one we use it, otherwise we use the hand coded type. In time, I would like to clean this up by changing IRgen to ask Sema/AST for the decl, which would then be lazily loaded from the builtin table if necessary. This could be used in a whole host of places in IRgen and would get rid of a lot of grotty hand coding of LLVM IR; however, we need some extra Sema support for this as well as support for builtin global variables. llvm-svn: 108482
* IRgen: Move blocks runtime interfaces to CodeGenModule.Daniel Dunbar2010-07-161-0/+20
| | | | llvm-svn: 108481
* When deferring the emission of declarations with initializers in C++, rememberJohn McCall2010-07-151-0/+6
| | | | | | | the order they appeared in the translation unit. If they get emitted, put them in their proper order. Fixes rdar://problem/7458115 llvm-svn: 108477
* CodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosingDaniel Dunbar2010-07-141-2/+6
| | | | | | | | whether to use objc_msgSend_fpret; the choice is target dependent, not Obj-C ABI dependent. - <rdar://problem/8139758> arm objc _objc_msgSend_fpret bug llvm-svn: 108379
* Provide a hook for the benefit of clients using clang IR gen as a subroutine:John McCall2010-07-061-0/+2
| | | | | | | | | | | | emit metadata associating allocas and global values with a Decl*. This feature is controlled by an option that (intentionally) cannot be enabled on the command line. To use this feature, simply set CodeGenOptions.EmitDeclMetadata = true; and then interpret the completely underspecified metadata. :) llvm-svn: 107739
* tidy up OrderGlobalInitsChris Lattner2010-06-271-13/+11
| | | | llvm-svn: 106976
* Patch to correctly mangle block helper functionsFariborz Jahanian2010-06-241-1/+1
| | | | | | | when block literal is declared inside a ctor/dtor. Fixes radr 8096995. llvm-svn: 106700
* Switch over to the new caching version of getMangledName.Anders Carlsson2010-06-221-1/+0
| | | | llvm-svn: 106549
* Add a new variant of getMangledName that caches the mangling for decls.Anders Carlsson2010-06-221-0/+5
| | | | llvm-svn: 106547
* Per Chris's comment, remove another static (this oneFariborz Jahanian2010-06-221-0/+14
| | | | | | is a static comparator operator). llvm-svn: 106511
* In supporting init-priority, globals with the same init_priority must beFariborz Jahanian2010-06-211-1/+9
| | | | | | emitted in the order in which they are seen (still radar 8076356). llvm-svn: 106485
* IRGen for implementation of init-priority attribute.Fariborz Jahanian2010-06-211-0/+5
| | | | | | | Test case will be checked in llvm test suite. (finishes off radar 8076356). llvm-svn: 106441
* Fix PR7097, a bad interaction between -fno-use-cxa-atexit andChris Lattner2010-06-191-2/+4
| | | | | | -mconstructor-aliases by using a WeakVH instead of a raw pointer. llvm-svn: 106384
* Get rid of getMangledCXXCtorName and getMangledCXXDtorName.Anders Carlsson2010-06-091-6/+0
| | | | llvm-svn: 105673
* Get rid of an unnecessary getMangledName overload.Anders Carlsson2010-06-091-1/+0
| | | | llvm-svn: 105671
* Fix for PR7040: Don't try to compute the LLVM type for a function where itEli Friedman2010-05-301-0/+4
| | | | | | | | | | | isn't possible to compute. This patch is mostly refactoring; the key change is the addition of the code starting with the comment, "Check whether the function has a computable LLVM signature." The solution here is essentially the same as the way the vtable code handles such functions. llvm-svn: 105151
* IRgen: Add a stub class for generating ABI-specific C++ code.Charles Davis2010-05-251-2/+18
| | | | | | | | This class only supports name mangling (which is apparently used during C/ObjC codegen). For now only the Itanium C++ ABI is supported. Patches to add a second C++ ABI are forthcoming. llvm-svn: 104630
* Improve name mangling for blocks and support mangling of static localDouglas Gregor2010-05-251-0/+1
| | | | | | | | | variables within blocks. We loosely follow GCC's mangling, but since these are always internal symbols the names don't really matter. I intend to revisit block mangling later, because GCC's mangling is rather verbose. <rdar://problem/8015719>. llvm-svn: 104610
* If a function definition has any sort of weak linkage, its static localJohn McCall2010-05-251-0/+4
| | | | | | | | | | | | variables should have that linkage. Otherwise, its static local variables should have internal linkage. To avoid computing this excessively, set a function's linkage before we emit code for it. Previously we were assigning weak linkage to the static variables of static inline functions in C++, with predictably terrible results. This fixes that and also gives better linkage than 'weak' when merging is required. llvm-svn: 104581
* Rework when and how vtables are emitted, by tracking where vtables areDouglas Gregor2010-05-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "used" (e.g., we will refer to the vtable in the generated code) and when they are defined (i.e., because we've seen the key function definition). Previously, we were effectively tracking "potential definitions" rather than uses, so we were a bit too eager about emitting vtables for classes without key functions. The new scheme: - For every use of a vtable, Sema calls MarkVTableUsed() to indicate the use. For example, this occurs when calling a virtual member function of the class, defining a constructor of that class type, dynamic_cast'ing from that type to a derived class, casting to/through a virtual base class, etc. - For every definition of a vtable, Sema calls MarkVTableUsed() to indicate the definition. This happens at the end of the translation unit for classes whose key function has been defined (so we can delay computation of the key function; see PR6564), and will also occur with explicit template instantiation definitions. - For every vtable defined/used, we mark all of the virtual member functions of that vtable as defined/used, unless we know that the key function is in another translation unit. This instantiates virtual member functions when needed. - At the end of the translation unit, Sema tells CodeGen (via the ASTConsumer) which vtables must be defined (CodeGen will define them) and which may be used (for which CodeGen will define the vtables lazily). From a language perspective, both the old and the new schemes are permissible: we're allowed to instantiate virtual member functions whenever we want per the standard. However, all other C++ compilers were more lazy than we were, and our eagerness was both a performance issue (we instantiated too much) and a portability problem (we broke Boost test cases, which now pass). Notes: (1) There's a ton of churn in the tests, because the order in which vtables get emitted to IR has changed. I've tried to isolate some of the larger tests from these issues. (2) Some diagnostics related to implicitly-instantiated/implicitly-defined virtual member functions have moved to the point of first use/definition. It's better this way. (3) I could use a review of the places where we MarkVTableUsed, to see if I missed any place where the language effectively requires a vtable. Fixes PR7114 and PR6564. llvm-svn: 103718
* Fix -fno-rtti -fexceptions by forcing the emission of (non-"builtin") RTTIJohn McCall2010-04-301-1/+1
| | | | | | when used by the exceptions routines. Fixes PR 6974. llvm-svn: 102684
* IRGen for initialization/destruction ofFariborz Jahanian2010-04-281-0/+1
| | | | | | | ivar class objects (NeXt runtime). (radar 7900343). llvm-svn: 102533
* Get rid of the old GetNonVirtualBaseClassOffset and change all call sites to ↵Anders Carlsson2010-04-241-4/+1
| | | | | | use the new version. llvm-svn: 102274
* Change CodeGenFunction::GetAddressOfDerivedClass to take a BasePath.Anders Carlsson2010-04-241-1/+4
| | | | llvm-svn: 102273
* More work toward implementingFariborz Jahanian2010-04-231-0/+4
| | | | | | NeXt's -fno-constant-cfstrings - wip. llvm-svn: 102189
* Support for -fno-constant-cfstrings option - wip.Fariborz Jahanian2010-04-221-0/+4
| | | | llvm-svn: 102112
* Some renaming of methods, fixes typoFariborz Jahanian2010-04-191-2/+2
| | | | | | (related to PR6769). llvm-svn: 101794
* Local static variables must be available module-wiseFariborz Jahanian2010-04-181-0/+9
| | | | | | | as they are accessible in static methods in a class local to the same function. Fixes PR6769. llvm-svn: 101756
* Vtable -> VTable renames across the board.Anders Carlsson2010-04-171-3/+3
| | | | llvm-svn: 101666
* Rename CGVtable files to CGVTables.Anders Carlsson2010-04-081-1/+1
| | | | llvm-svn: 100778
* Unbreak the buildDouglas Gregor2010-04-081-1/+2
| | | | llvm-svn: 100775
* Reapply patch for adding support for address spaces and added a isVolatile ↵Mon P Wang2010-04-041-7/+11
| | | | | | field to memcpy, memmove, and memset. llvm-svn: 100305
* Revert r100193 since it causes failures in objc in clangMon P Wang2010-04-021-11/+3
| | | | llvm-svn: 100200
* Reapply patch for adding support for address spaces and added a isVolatile ↵Mon P Wang2010-04-021-3/+11
| | | | | | field to memcpy, memmove, and memset. llvm-svn: 100193
* Minor include pruning.Benjamin Kramer2010-03-311-1/+0
| | | | llvm-svn: 100007
* Revert Mon Ping's 99930 due to broken llvm-gcc buildbots.Bob Wilson2010-03-301-11/+7
| | | | llvm-svn: 99949
* Added support for address spaces and added a isVolatile field to memcpy, ↵Mon P Wang2010-03-301-7/+11
| | | | | | memmove, and memset llvm-svn: 99930
* Remove the old vtable layout code.Anders Carlsson2010-03-301-10/+0
| | | | llvm-svn: 99869
* When given the magic class __cxxabiv1::__fundamental_type_info, produceRafael Espindola2010-03-271-0/+8
| | | | | | | | the typeinfo for the fundamental types. Fixes PR6685. llvm-svn: 99701
* Remove old thunks code.Anders Carlsson2010-03-241-11/+0
| | | | llvm-svn: 99374
* More thunks scaffolding.Anders Carlsson2010-03-231-0/+3
| | | | llvm-svn: 99294
* 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-2/+13
| | | | | | | | - 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-40/+17
| | | | | | | | | | | | | 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-1/+2
| | | | | | | | | 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
OpenPOWER on IntegriCloud