summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a string over-run detected by ASAN.Nick Lewycky2012-01-181-2/+3
| | | | llvm-svn: 148375
* Fix special king of typo.Nick Lewycky2012-01-181-1/+1
| | | | llvm-svn: 148368
* De-virtualize getPreviousDecl() and getMostRecentDecl() when we knowDouglas Gregor2012-01-141-1/+1
| | | | | | | | | | | | we have a redeclarable type, and only use the new virtual versions (getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have that type information. This keeps us from penalizing users with strict type information (and is the moral equivalent of a "final" method). Plus, settle on the names getPreviousDecl() and getMostRecentDecl() throughout. llvm-svn: 148187
* constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,Richard Smith2012-01-141-3/+4
| | | | | | | | | | | | | | | | | | | | 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
* The `-fwritable-strings' flag doesn't make the backing store strings of allBill Wendling2012-01-101-10/+6
| | | | | | | | | | | CFStrings writable. The strings (both Unicode and ASCII) should reside in a read-only section. E.g., __TEXT,__cstring instead of __DATA,__data. This is done by making the global variable created for the strings constant despite the value of that flag. <rdar://problem/10657500> llvm-svn: 147845
* Eliminate ObjCForwardProtocolDecl, which is redundant now thatDouglas Gregor2012-01-011-4/+6
| | | | | | ObjCProtocolDecl modules forward declarations properly. llvm-svn: 147415
* Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor2011-12-271-1/+0
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* Extend the fix for PR9614 to handle inline asm in the outer decl andRafael Espindola2011-12-191-15/+32
| | | | | | | the inner decl being a builtin. This is needed to support the glibc headers in fedora 16 (2.14). llvm-svn: 146867
* Introduce a module import declaration, so that we properly represent, e.g.,Douglas Gregor2011-12-021-0/+1
| | | | | | | | __import_module__ std.vector; in the AST. llvm-svn: 145725
* Fix the representation of wide strings in the AST and IR so that it uses the ↵Eli Friedman2011-11-011-24/+51
| | | | | | | | | | 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
* Fix PR9614 for functions with the always_inline attribute. Try to keepRafael Espindola2011-10-281-6/+3
| | | | | | the common case (-O0, no always_inline) fast. llvm-svn: 143222
* Fix pr9614 by not emitting an available_externally function when it callsRafael Espindola2011-10-261-4/+58
| | | | | | | | | 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
* Replace vectors with arrays.Benjamin Kramer2011-10-151-2/+2
| | | | llvm-svn: 142072
* Recommit:Eric Christopher2011-10-131-3/+1
| | | | | | | | | | | | | | | Start handling debug line and scope information better: Migrate most of the location setting within the larger API in CGDebugInfo and update a lot of callers. Remove the existing file/scope change machinery in UpdateLineDirectiveRegion and replace it with DILexicalBlockFile usage. Finishes off the rest of rdar://10246360 after fixing a few bugs that were exposed in gdb testsuite testing. llvm-svn: 141893
* Revert file/scope handling patches. gdb testing revealed a couple of bugs.Eric Christopher2011-10-121-1/+3
| | | | llvm-svn: 141796
* Start handling debug line and scope information better:Eric Christopher2011-10-111-3/+1
| | | | | | | | | | | Migrate most of the location setting within the larger API in CGDebugInfo and update a lot of callers. Remove the existing file/scope change machinery in UpdateLineDirectiveRegion and replace it with DILexicalBlockFile usage. Finishes off the rest of rdar://10246360 llvm-svn: 141732
* Free 'TheTargetCodeGenInfo' in the class CodeGenModule. This looks like an ↵Ted Kremenek2011-10-081-0/+1
| | | | | | obvious memory leak that was reported from LLDB devs. The comment indicates the leak is deliberate, but I have no idea why this needs to be so. Please comment/revert if you know otherwise. llvm-svn: 141479
* CUDA: add -fcuda-is-device flagPeter Collingbourne2011-10-061-0/+17
| | | | | | | This frontend-only flag is used by the IR generator to determine whether to filter CUDA declarations for the host or for the device. llvm-svn: 141301
* CUDA: IR generation support for kernel call expressionsPeter Collingbourne2011-10-061-3/+11
| | | | llvm-svn: 141300
* Allow getting all source locations of selector identifiers in a ObjCMethodDecl.Argyrios Kyrtzidis2011-10-031-2/+0
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989
* Pass from the parser the locations of selector identifiers when creatingArgyrios Kyrtzidis2011-10-031-1/+4
| | | | | | | | objc method decls. They are not stored in the AST yet. llvm-svn: 140984
* Make -fobjc-nonfragile-abi the -cc1 default, since it's theJohn McCall2011-10-021-1/+21
| | | | | | | | | | | | | | | | | | | increasingly prevailing case to the point that new features like ARC don't even support the fragile ABI anymore. This required a little bit of reshuffling with exceptions because a check was assuming that ObjCNonFragileABI was only being set in ObjC mode, and that's actually a bit obnoxious to do. Most, though, it involved a perl script to translate a ton of test cases. Mostly no functionality change for driver users, although there are corner cases with disabling language-specific exceptions that we should handle more correctly now. llvm-svn: 140957
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-4/+4
| | | | llvm-svn: 140478
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* OpenCL: introduce support for function scope __local variablesPeter Collingbourne2011-09-191-3/+11
| | | | llvm-svn: 140068
* In apple-kext mode, use external linkage for explicit template instantiationsJohn McCall2011-09-191-2/+7
| | | | | | instead of internal linkage. llvm-svn: 140030
* Correctly generate IR for casted "builtin" functions, whereJohn McCall2011-09-131-30/+0
| | | | | | | the builtin is really just a predefined declaration. These are totally valid to cast. llvm-svn: 139657
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-2/+2
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: canJulien Lerouge2011-09-091-61/+70
| | | | | | | annotate global, local variables, struct fields, or arbitrary statements (using the __builtin_annotation), rdar://8037476. llvm-svn: 139423
* Treat the weak export of block runtime symbols as a deployment-targetJohn McCall2011-09-091-90/+0
| | | | | | | | feature akin to the ARC runtime checks. Removes a terrible hack where IR gen needed to find the declarations of those symbols in the translation unit. llvm-svn: 139404
* Do a lookup for the blocks runtime globals to see if they were declared,Argyrios Kyrtzidis2011-09-091-45/+36
| | | | | | | | | 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-11/+11
| | | | | | | | 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
* Make sure we don't inline functions marked with __attribute__((naked)). ↵Eli Friedman2011-08-221-4/+9
| | | | | | <rdar://problem/9973228> llvm-svn: 138310
* Mark objc methods that are implicitly declared for properties (not ↵Argyrios Kyrtzidis2011-08-171-3/+9
| | | | | | | | user-declared) as implicit. This results in libclang ignoring such methods. llvm-svn: 137852
* Finalize debug info after all deferred globals are emitted.Devang Patel2011-08-161-2/+3
| | | | llvm-svn: 137750
* Use new DIBuilder::finalize() at the end to wrap up debug info encoding for ↵Devang Patel2011-08-151-0/+2
| | | | | | a translation unit. llvm-svn: 137674
* Move the creation of the record type for the state of Objective-C fastDouglas Gregor2011-08-091-0/+35
| | | | | | | | 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-6/+46
| | | | | | | | 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-14/+24
| | | | | | Patch by Craig Topper and Sundeep! llvm-svn: 136856
* When rewriting a call to a K&R function to lead to a well-prototypedJohn McCall2011-08-031-1/+20
| | | | | | | function, be sure to drop parameter attributes when dropping their associated arguments. Patch by Aaron Landwehr! llvm-svn: 136753
* CodeGen: rename CodeGenModule::Runtime to ObjCRuntimePeter Collingbourne2011-07-271-9/+9
| | | | llvm-svn: 136254
* Add support for C++0x unicode string and character literals, from Craig Topper!Douglas Gregor2011-07-271-2/+14
| | | | llvm-svn: 136210
* Rename getInstantiationLineNumber to getExpansionLineNumber in bothChandler Carruth2011-07-251-2/+2
| | | | | | SourceManager and FullSourceLoc. llvm-svn: 135969
* fix PR10415, tidying up IR representation of module level inline asmChris Lattner2011-07-231-0/+2
| | | | | | to avoid extraneous \n's. llvm-svn: 135862
* Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon ↵Chris Lattner2011-07-231-1/+1
| | | | | | Mulder! llvm-svn: 135855
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-32/+32
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.Jordy Rose2011-07-221-3/+2
| | | | | | | | | This was previously not-const only because it has to lazily construct a chain of ivars the first time it is called (and after the chain is invalidated). In practice, all the clients were just const_casting their const Decls; all those now-unnecessary const_casts have been removed. llvm-svn: 135741
* Convert ConstantExpr::getGetElementPtr andJay Foad2011-07-211-4/+4
| | | | | | ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
* In C99, emit an inline function when encountering an extern redeclaration.Nick Lewycky2011-07-181-2/+15
| | | | | | Fixes PR10233! llvm-svn: 135377
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-29/+29
| | | | llvm-svn: 135370
OpenPOWER on IntegriCloud