summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r153723, and its follow-ups r153728 and r153733.Chandler Carruth2012-03-301-1/+1
| | | | | | | | | | | | | | | | These patches cause us to miscompile and/or reject code with static function-local variables in an extern-C context. Previously, we were papering over this as long as the variables are within the same translation unit, and had not seen any failures in the wild. We still need a proper fix, which involves mangling static locals inside of an extern-C block (as GCC already does), but this patch causes pretty widespread regressions. Firefox, and many other applications no longer build. Lots of test cases have been posted to the list in response to this commit, so there should be no problem reproducing the issues. llvm-svn: 153768
* Do the static-locals thing properly in the face of unions andJohn McCall2012-03-301-1/+1
| | | | | | other things which might mess with the variable's type. llvm-svn: 153733
* add tbaa metadata to vtable pointer loads/storesKostya Serebryany2012-03-261-0/+1
| | | | llvm-svn: 153447
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-3/+3
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Make sure we update the static local decl address map when we are forced to ↵Eli Friedman2012-03-091-5/+5
| | | | | | rebuild a global because of the initializer. <rdar://problem/10957867>. llvm-svn: 152372
* Replace MarkVarRequired with a more genericRafael Espindola2012-03-081-4/+3
| | | | | | HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios. llvm-svn: 152320
* Fix a small difference in sema and codegen views of what needs to be output.Rafael Espindola2012-03-051-0/+5
| | | | | | | | | | | | In the included testcase, soma thinks that we already have a definition after we see the out of line decl. Codegen puts it in a deferred list, to be output if a use is seen. This would break when we saw an explicit template instantiation definition, since codegen would not be notified. This patch adds a method to the consumer interface so that soma can notify codegen that this decl is now required. llvm-svn: 152024
* Reinstate r151879, r151880, reverted in r151922, along with a bugfix forRichard Smith2012-03-021-2/+8
| | | | | | | | | scalar emission of DeclRefExprs to const bools: emit scalar bools as i1, not as i8. In addition to the extra unit testing, this has successfully bootstrapped. llvm-svn: 151955
* CodeGen support for global variables of type std::initializer_list<X>.Sebastian Redl2012-02-251-0/+3
| | | | | | | | | | | | | This emits a backing array with internal linkage and fills it with data, then has the initializer_list point at the array. Dynamic initialization and global destructors are correctly supported. What doesn't work is nested initializer_lists. I have no idea how to get them to work, either. However, these should be very rare, and so I'll just call it a known bug and declare generalized initializers DONE! llvm-svn: 151457
* Bug fix: do not emit static const local variables with mutable membersRichard Smith2012-02-171-0/+2
| | | | | | | | | as constants. Refactor and simplify all the separate checks for whether a type can be emitted as a constant. llvm-svn: 150793
* 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
OpenPOWER on IntegriCloud