summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Change intrinsic getter to take an ArrayRef, now that the underlying ↵Benjamin Kramer2011-07-141-2/+2
| | | | | | function in LLVM does. llvm-svn: 135155
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-15/+15
| | | | llvm-svn: 134831
* Change the IR-generation of VLAs so that we capture bounds,John McCall2011-06-241-0/+4
| | | | | | | not sizes; so that we use well-typed allocas; and so that we properly recurse through the full set of variably-modified types. llvm-svn: 133827
* Automatic Reference Counting.John McCall2011-06-151-3/+84
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Move GlobalDecl to ASTPeter Collingbourne2011-06-141-1/+1
| | | | llvm-svn: 132973
* Use arrays and SmallVectors instead of std::vectors when building functionJohn McCall2011-05-151-1/+5
| | | | | | | types. Also, cache a translation of 'void' in CGM and provide a ptrdiff_t alias. No functionality change. llvm-svn: 131373
* Preserve the full name of the file, so that '-c -o foo.pic.o' producesNick Lewycky2011-05-051-2/+2
| | | | | | foo.pic.gcno instead of foo.gcno. llvm-svn: 130899
* Record where the GCOV data files should be placed.Nick Lewycky2011-05-041-0/+4
| | | | llvm-svn: 130866
* After some discussion with Doug, we decided that it made a lot more senseJohn McCall2011-04-121-1/+0
| | | | | | | | | for __unknown_anytype resolution to destructively modify the AST. So that's what it does now, which significantly simplifies some of the implementation. Normal member calls work pretty cleanly now, and I added support for propagating unknown-ness through &. llvm-svn: 129331
* Basic, untested implementation for an "unknown any" type requested by LLDB.John McCall2011-04-071-0/+2
| | | | | | | | | | | | The idea is that you can create a VarDecl with an unknown type, or a FunctionDecl with an unknown return type, and it will still be valid to access that object as long as you explicitly cast it at every use. I'm still going back and forth about how I want to test this effectively, but I wanted to go ahead and provide a skeletal implementation for the LLDB folks' benefit and because it also improves some diagnostic goodness for placeholder expressions. llvm-svn: 129065
* After much contemplation, I've decided that we probably shouldn't "unique"John McCall2011-03-311-11/+29
| | | | | | | | | | | | | __block object copy/dispose helpers for C++ objects with those for different variables with completely different semantics simply because they happen to both be no more aligned than a pointer. Found by inspection. Also, internalize most of the helper generation logic within CGBlocks.cpp, and refactor it to fit my peculiar aesthetic sense. llvm-svn: 128618
* We were emitting construction v-tables with internal linkage all the time.John McCall2011-03-271-0/+1
| | | | | | | | | | | | | | | Emit them instead with the linkage of the VTT. I'm actually really ambivalent about this; it's what GCC does, but outside of improving code size (if the linkage is coalescing), I'm not sure it's at all relevant. Construction vtables are naturally referenced only by the VTT, which is itself only referenced by complete-object constructors and destructors; giving the construction vtables possibly-external linkage is important if you have an optimization that drills through the VTT to a reference to a particular construction vtable which it cannot just emit itself. llvm-svn: 128374
* Update type cache when a type is completed.Devang Patel2011-03-231-4/+2
| | | | | | Radar 9168773 llvm-svn: 128150
* The Darwin kernel does not provide useful guard variable support.John McCall2011-03-181-0/+3
| | | | | | | | Issue this as an IR-gen error; it's not really worthwhile doing this "right", i.e. in Sema, because IR gen knows a lot of tricks beyond what the constant evaluator knows. llvm-svn: 127854
* Fix three of the four places where I left breadcrumbs to avoid unnecessaryJohn McCall2011-03-091-4/+6
| | | | | | recomputation. llvm-svn: 127322
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-1/+2
| | | | | | | | | | simplify the logic of initializing function parameters so that we don't need both a variable declaration and a type in FunctionArgList. This also means that we need to propagate the CGFunctionInfo down in a lot of places rather than recalculating it from the FAL. There's more we can do to eliminate redundancy here, and I've left FIXMEs behind to do it. llvm-svn: 127314
* DebugInfo can be enabled or disabled at function level (e.g. using an ↵Devang Patel2011-03-071-8/+1
| | | | | | attribute). However, at module level it is determined by command line option and the state of command line option does not change during compilation. Make this layering explicit and fix accidental cases where the code generator was checking whether module has debug info enabled instead of checking whether debug info is enabled for this function or not. llvm-svn: 127165
* Do not emit stop point for CXXDefaultArgExpr. It results in suboptimial user ↵Devang Patel2011-03-071-1/+9
| | | | | | | | | | | | | experience. 21 int main() { 22 A a; For example, here user would expect to stop at line 22, even if A's constructor leads to a call through CXXDefaultArgExpr. This fixes ostream-defined.exp regression from gdb testsuite. llvm-svn: 127164
* StringRefify.Benjamin Kramer2011-03-051-1/+1
| | | | llvm-svn: 127082
* Pretty up the emission of field l-values and use volatile and TBAA whenJohn McCall2011-02-261-0/+2
| | | | | | | loading references as part of that. Use 'char' TBAA when accessing (immediate!) fields of a may_alias struct; fixes PR9307. llvm-svn: 126540
* Emit the structure layout of the block literal parameter to a blockJohn McCall2011-02-221-2/+2
| | | | | | | | | | invocation function into the debug info. Rather than faking up a class, which is tricky because of the custom layout we do, we just emit a struct directly from the layout information we've already got. Also, don't emit an unnecessarily parameter alloca for this "variable". llvm-svn: 126255
* Reorganize the emission of local variables.John McCall2011-02-221-1/+4
| | | | llvm-svn: 126189
* Assorted cleanup:John McCall2011-02-151-3/+30
| | | | | | | | | - Have CGM precompute a number of commonly-used types - Have CGF copy that during initialization instead of recomputing them - Use TBAA info when initializing a parameter variable - Refactor the scalar ++/-- code llvm-svn: 125562
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-2/+38
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* Simplify thunks code.Anders Carlsson2011-02-061-2/+1
| | | | llvm-svn: 124983
* Pass a 'ForVTable' flag to GetAddrOfThunk and pass it along to ↵Anders Carlsson2011-02-051-1/+2
| | | | | | | | GetOrCreateLLVMFunction so that we won't assert when building a thunk for an implicit virtual member function that is not marked used. llvm-svn: 124967
* Re-land r124768, with a fix for PR9130.Anders Carlsson2011-02-051-2/+4
| | | | | | We now emit everything except unused implicit virtual member functions when building the vtable. llvm-svn: 124935
* More capturing of 'this': implicit member expressions. Getting thatJohn McCall2011-02-031-0/+2
| | | | | | | | | | | right for anonymous struct/union members led to me discovering some seemingly broken code in that area of Sema, which I fixed, partly by changing the representation of member pointer constants so that IndirectFieldDecls aren't expanded. This led to assorted cleanups with member pointers in CodeGen, and while I was doing that I saw some random other things to clean up. llvm-svn: 124785
* Revert 124768.Rafael Espindola2011-02-031-4/+2
| | | | | | | This reopens PR99114, but that one at least can be avoided with an #include. PR9130 cannot. llvm-svn: 124780
* Don't try to mark virtual members referenced for classes where the key functionAnders Carlsson2011-02-031-2/+4
| | | | | | | | | | | is not defined in the current translation unit. Doing so lead to compile errors such as PR9114. Instead, when CodeGen is building the vtable, don't try to emit a definition for functions that aren't marked used in the current translation unit. Fixes PR9114. llvm-svn: 124768
* Move GetLLVMVisibility to CodeGenModule.Anders Carlsson2011-01-291-0/+10
| | | | llvm-svn: 124550
* Change CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum ↵Anders Carlsson2011-01-291-1/+10
| | | | | | instead of an "IsForRTTI" flag. llvm-svn: 124546
* Get rid of an unneeded parameter from setGlobalVisibility.Anders Carlsson2011-01-291-2/+1
| | | | llvm-svn: 124541
* Add a new function, to be used by CGRTTI, CGVTables and CGVTT (which each ↵Anders Carlsson2011-01-291-0/+8
| | | | | | has their own copy of this code). llvm-svn: 124537
* Remove IsDefinition from CodeGenModule::setTypeVisibility; it is always true.Anders Carlsson2011-01-291-1/+1
| | | | llvm-svn: 124529
* Change CodeGenModule::getVTableLinkage to be a non-static member function.Anders Carlsson2011-01-241-2/+1
| | | | llvm-svn: 124095
* Add unnamed_addr in CreateRuntimeVariable.Rafael Espindola2011-01-181-1/+2
| | | | llvm-svn: 123773
* Move name mangling support from CodeGen to AST. In thePeter Collingbourne2011-01-131-4/+5
| | | | | | | | | | | | | | process, perform a number of refactorings: - Move MiscNameMangler member functions to MangleContext - Remove GlobalDecl dependency from MangleContext - Make MangleContext abstract and move Itanium/Microsoft functionality to their own classes/files - Implement ASTContext::createMangleContext and have CodeGen use it No (intended) functionality change. llvm-svn: 123386
* Simplify mem{cpy, move, set} creation with IRBuilder.Benjamin Kramer2010-12-301-11/+0
| | | | llvm-svn: 122634
* Simplify the logic for emitting guard variables for template staticJohn McCall2010-11-061-1/+2
| | | | | | | | | data members by delaying the emission of the initializer until after linkage and visibility have been set on the global. Also, don't emit a guard unless the variable actually ends up with vague linkage, and don't use thread-safe statics in any case. llvm-svn: 118336
* Better solution: calculate the visibility of functions and variablesJohn McCall2010-10-301-2/+3
| | | | | | | | | | independently of whether they're definitions, then teach IR generation to ignore non-explicit visibility when emitting declarations. Use this to make sure that RTTI, vtables, and VTTs get the right visibility. More of rdar://problem/8613093 llvm-svn: 117781
* Do the guarding of instantiated static data membersFariborz Jahanian2010-10-271-2/+8
| | | | | | | | on if its linkage is weak. Currently this is the case but may change in the future. (part of radar 8562966). llvm-svn: 117452
* Substantially revise how clang computes the visibility of a declaration toJohn McCall2010-10-221-4/+1
| | | | | | | | more closely parallel the computation of linkage. This gets us to a state much closer to what gcc emits, modulo bugs, which will undoubtedly arise in abundance. llvm-svn: 117147
* This patch implements Next's IRGen for -fconstant-string-class=class-name.Fariborz Jahanian2010-10-191-5/+6
| | | | | | PR6056, //rdar: //8564463 llvm-svn: 116819
* Experimental TBAA support.Dan Gohman2010-10-141-0/+7
| | | | | | | This enables metadata generation by default, however the TBAA pass in the optimizer is still disabled for now. llvm-svn: 116536
* Opportunistically use the C++ personality function in ObjC++John McCall2010-09-161-0/+4
| | | | | | translation units that don't catch ObjC types. rdar://problem/8434851 llvm-svn: 114070
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-4/+1
| | | | | | under the ARM ABI. llvm-svn: 112588
* Abstract out everything having to do with member pointers into the ABIJohn McCall2010-08-231-2/+0
| | | | | | | | | | | class; they should just be completely opaque throughout IR gen now, although I haven't really audited that. Fix a bug apparently inherited from gcc-4.2 where we failed to null-check member data pointers when performing derived-to-base or base-to-derived conversions on them. llvm-svn: 111789
* Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall2010-08-221-14/+4
| | | | | | | | | Make CGT defer to the ABI on all member pointer types. This requires giving CGT a handle to the ABI. It's way easier to make that work if we avoid lazily creating the ABI. Make it so. llvm-svn: 111786
* Abstract out member-pointer creation. I'm really unhappy about the currentJohn McCall2010-08-221-4/+0
| | | | | | | | duplication between the constant and non-constant paths in all of this. Implement ARM ABI semantics for member pointer constants and conversion. llvm-svn: 111772
OpenPOWER on IntegriCloud