summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
Commit message (Collapse)AuthorAgeFilesLines
* Teach clang to add metadata tags to calls and invokes in ObjC withDan Gohman2012-02-161-0/+9
| | | | | | | | | -fno-objc-arc-exceptions. This will allow the optimizer to perform optimizations which are only safe under that flag. This is a part of rdar://10803830. llvm-svn: 150644
* Deal with a horrible C++11 special case. If a non-literal type has a constexprRichard Smith2012-02-131-1/+4
| | | | | | | | | | | constructor, and that constructor is used to initialize an object of static storage duration such that all members and bases are initialized by constant expressions, constant initialization is performed. In this case, the object can still have a non-trivial destructor, and if it does, we must emit a dynamic initializer which performs no initialization and instead simply registers that destructor. llvm-svn: 150419
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-2/+4
| | | | | | CodeGenModule. llvm-svn: 149943
* use cheaper llvm APIs for various bits of IR generation.Chris Lattner2012-02-061-5/+0
| | | | llvm-svn: 149916
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-1/+0
| | | | llvm-svn: 148577
* constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,Richard Smith2012-01-141-0/+10
| | | | | | | | | | | | | | | | | | | | APValue::Array and APValue::MemberPointer. All APValue values can now be emitted as constants. Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other entrypoints dealing with constant member pointers are no longer necessary and will be removed in a later change. Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to VarDecl::evaluateValue. This performs caching and deals with the nasty cases in C++11 where a non-const object's initializer can refer indirectly to previously-initialized fields within the same object. Building the intermediate APValue object incurs a measurable performance hit on pathological testcases with huge initializer lists, so we continue to build IR directly from the Expr nodes for array and record types outside of C++11. llvm-svn: 148178
* objc++: more atomic property api code forFariborz Jahanian2012-01-081-5/+14
| | | | | | c++ object properties. wip. llvm-svn: 147750
* objc++: more code gen stuff for atomic property api,Fariborz Jahanian2012-01-061-0/+10
| | | | | | | | currently turned off. // rdar://6137845 Also, fixes a test case which should be nonatomic under new API. llvm-svn: 147691
* Extend the fix for PR9614 to handle inline asm in the outer decl andRafael Espindola2011-12-191-1/+1
| | | | | | | the inner decl being a builtin. This is needed to support the glibc headers in fedora 16 (2.14). llvm-svn: 146867
* Use static storage duration for file-scope compound literals, even when theyRichard Smith2011-11-221-0/+4
| | | | | | appear in non-constant initializers in C++. llvm-svn: 145087
* Remove unnecessary include.Devang Patel2011-11-091-1/+0
| | | | llvm-svn: 144210
* Fix the representation of wide strings in the AST and IR so that it uses the ↵Eli Friedman2011-11-011-0/+4
| | | | | | | | | | native representation of integers for the elements. This fixes a bunch of nastiness involving treating wide strings as a series of bytes. Patch by Seth Cantrell. llvm-svn: 143417
* In x86_64, when calling an Objective-C method that returns a _Complex long ↵Anders Carlsson2011-10-311-2/+6
| | | | | | double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil. llvm-svn: 143350
* Fix pr9614 by not emitting an available_externally function when it callsRafael Espindola2011-10-261-0/+2
| | | | | | | | | itself via an asm label. available_externally functions are supposed to correspond to an external function, and that is not the case in the examples in pr9614. llvm-svn: 143049
* PR11124: Don't overwrite memory outside of a base class when performing ↵Eli Friedman2011-10-141-0/+5
| | | | | | zero-initialization before running its constructor. llvm-svn: 141933
* CUDA: IR generation support for kernel call expressionsPeter Collingbourne2011-10-061-1/+10
| | | | llvm-svn: 141300
* Create a VTableContext class and start moving CodeGenVTables methods to itPeter Collingbourne2011-09-261-0/+1
| | | | llvm-svn: 140502
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-4/+5
| | | | llvm-svn: 140478
* OpenCL: introduce support for function scope __local variablesPeter Collingbourne2011-09-191-0/+10
| | | | llvm-svn: 140068
* Simplify the generation of Objective-C setters, at least a little.John McCall2011-09-101-2/+6
| | | | | | | | | Use a more portable heuristic for deciding when to emit a single atomic store; it's possible that I've lost information here, but I'm not sure how much of the logic before was intentionally arch-specific and how much was just not quite consistent. llvm-svn: 139468
* Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: canJulien Lerouge2011-09-091-7/+31
| | | | | | | annotate global, local variables, struct fields, or arbitrary statements (using the __builtin_annotation), rdar://8037476. llvm-svn: 139423
* Do a lookup for the blocks runtime globals to see if they were declared,Argyrios Kyrtzidis2011-09-091-4/+0
| | | | | | | | | instead of codegen waiting to consume such a declaration, which won't happen if that decls are coming from a PCH. Fixes rdar://10028656. llvm-svn: 139359
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-1/+1
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Move the creation of the record type for the state of Objective-C fastDouglas Gregor2011-08-091-0/+8
| | | | | | | | enumerations from the ASTContext into CodeGen, so that we don't need to serialize it to AST files. This appears to be the last of the low-hanging fruit for SpecialTypes. llvm-svn: 137124
* Move the construction of the RecordDecl representing the runtimeDouglas Gregor2011-08-091-0/+8
| | | | | | | | layout of a constant NSString from the ASTContext over to CodeGen, since this is solely CodeGen's responsibility. Eliminates one of the unnecessary "special" types that we serialize. llvm-svn: 137121
* Emit wide string literals with the appropriate alignment.John McCall2011-08-041-3/+5
| | | | | | Patch by Craig Topper and Sundeep! llvm-svn: 136856
* CodeGen: rename CodeGenModule::Runtime to ObjCRuntimePeter Collingbourne2011-07-271-4/+4
| | | | llvm-svn: 136254
* Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon ↵Chris Lattner2011-07-231-2/+2
| | | | | | Mulder! llvm-svn: 135855
* now that we have a centralized place to do so, add some using declarations forChris Lattner2011-07-201-11/+11
| | | | | | | some common llvm types: stringref and smallvector. This cleans up the codebase quite a bit. llvm-svn: 135576
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-8/+8
| | | | llvm-svn: 135370
* 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
OpenPOWER on IntegriCloud