summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* add tbaa metadata to vtable pointer loads/storesKostya Serebryany2012-03-265-2/+20
| | | | llvm-svn: 153447
* Simplify some users of DenseMap::erase.Benjamin Kramer2012-03-242-8/+2
| | | | llvm-svn: 153389
* Add back r153360 with a fix for enums that cover all the 32 bit values.Rafael Espindola2012-03-242-8/+63
| | | | | | Thanks to NAKAMURA Takumi for finding it! llvm-svn: 153383
* Revert r153360 (and r153380), "Second part of PR12251. Produce the range ↵NAKAMURA Takumi2012-03-242-62/+8
| | | | | | | | | | metadata in clang for booleans and". For i686 targets (eg. cygwin), I saw "Range must not be empty!" in verifier. It produces (i32)[0x80000000:0x80000000) from (uint64_t)[0xFFFFFFFF80000000ULL:0x0000000080000000ULL), for signed i32 on MDNode::Range. llvm-svn: 153382
* Second part of PR12251. Produce the range metadata in clang for booleans andRafael Espindola2012-03-242-8/+62
| | | | | | c++ enums. llvm-svn: 153360
* use EP_OptimizerLast instead of EP_ScalarOptimizerLate for ThreadSanitizerKostya Serebryany2012-03-231-1/+1
| | | | llvm-svn: 153356
* When an MMX output variable is tied to the input variable, we have to implicitlyBill Wendling2012-03-221-1/+6
| | | | | | | cast the value to x86_mmx. This gives the ASM string the correct call signature. <rdar://problem/10919182> llvm-svn: 153290
* Make sure we correctly set the alignment for vector loads and stores ↵Eli Friedman2012-03-222-19/+33
| | | | | | associated with vector element lvalues. Patch by Kevin Schoedel (with some minor modifications by me). llvm-svn: 153285
* Update comment.Eric Christopher2012-03-201-2/+1
| | | | llvm-svn: 153149
* Fix a use-after-free in thunk emission. EmitThunk may call RAUW on Init, ↵Benjamin Kramer2012-03-201-1/+1
| | | | | | | | invalidating the pointer. Fixes PR12284. The test case only triggered under asan/valgrind, but it's better than nothing. llvm-svn: 153120
* Debug info: Tighten up uses of plain MDNode pointers which don't survive ↵Benjamin Kramer2012-03-201-15/+13
| | | | | | | | replaceOperandWith. TrackingVH notices when it gets RAUW'd. Fixes PR12305 and PR12315. llvm-svn: 153115
* Add missing bitcast that was breaking Objective-C++ exception typeinfo ↵David Chisnall2012-03-201-1/+2
| | | | | | (GNUstep runtime). llvm-svn: 153090
* Escape % in diagnostic message when compiling LLVM IR.Benjamin Kramer2012-03-161-1/+11
| | | | | | | % is a common character in IR so we'd crash on almost any malformed IR. The diagnostic formatter expects a formatting directive when it sees an unescaped %. llvm-svn: 152956
* When "low alignment" is specified, then set the alignment of the aggregate'sBill Wendling2012-03-161-1/+3
| | | | | | | | | | store to 1. This allows code-gen to select a more appropriate alignment. If left to zero, an alignment greater than the alignment of the pointer may be selected, causing code-gen to use instructions which require an alignment greater than the pointer guarantees. <rdar://problem/11043589> llvm-svn: 152951
* Don't try to create "store atomic" instructions of non-integer types; they ↵Eli Friedman2012-03-161-4/+5
| | | | | | aren't supported at the moment. PR12040. llvm-svn: 152891
* When a variable has a specified asm name, but isn't using the register ↵Eli Friedman2012-03-151-0/+2
| | | | | | storage class, the asm name doesn't specify a register. PR12244. llvm-svn: 152873
* Fix codegen for vld{3,4}_dup intrinsics.James Molloy2012-03-151-4/+4
| | | | | | Patch by Silviu Baranga! llvm-svn: 152788
* [frontend] Add support for disabling the "inline" keyword using Chad Rosier2012-03-141-7/+8
| | | | | | | | | | | -fno-inline-functions. This behaves much like -fno-inline in gcc, but based on a discussion with Daniel it was decided that -fno-inline-functions should subsume -fno-inline. Please speak up if you object. The -fno-inline flag remains ignored. Final part of rdar://10972766 llvm-svn: 152754
* Add support to mangle templated member function names with templateEric Christopher2012-03-141-1/+14
| | | | | | | | args. Fixes rdar://11042577 llvm-svn: 152691
* When adding member functions to a class add any specializations ofEric Christopher2012-03-131-9/+22
| | | | | | | | | | | function templates as well. A future commit will mangle the added name with the template args like classes are mangled. Fixes rdar://10986010 llvm-svn: 152683
* [Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() ↵Argyrios Kyrtzidis2012-03-131-3/+3
| | | | | | | | | iterators instead of ObjCInterfaceDecl::getReferencedProtocols(), because the iterators are safe to use even if the caller did not check that the interface is a definition. llvm-svn: 152597
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-1128-207/+207
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* llvm::SwitchInstStepan Dyatkovskiy2012-03-111-1/+1
| | | | | | | Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default. Added some notes relative to case iterators. llvm-svn: 152533
* Simplify code. No functionality change.Benjamin Kramer2012-03-101-14/+5
| | | | llvm-svn: 152503
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-108-108/+70
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
* Unify the BlockDeclRefExpr and DeclRefExpr paths so thatJohn McCall2012-03-105-52/+201
| | | | | | | | we correctly emit loads of BlockDeclRefExprs even when they don't qualify as ODR-uses. I think I'm adequately convinced that BlockDeclRefExpr can die. llvm-svn: 152479
* IRgen/ABI/x86_64: Avoid passing small structs using byval sometimes.Daniel Dunbar2012-03-101-9/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - We do this when it is easy to determine that the backend will pass them on the stack properly by itself. Currently LLVM codegen is really bad in some cases with byval, for example, on the test case here (which is derived from Sema code, which likes to pass SourceLocations around):: struct s47 { unsigned a; }; void f47(int,int,int,int,int,int,struct s47); void test47(int a, struct s47 b) { f47(a, a, a, a, a, a, b); } we used to emit code like this:: ... movl %esi, -8(%rbp) movl -8(%rbp), %ecx movl %ecx, (%rsp) ... to handle moving the struct onto the stack, which is just appalling. Now we generate:: movl %esi, (%rsp) which seems better, no? llvm-svn: 152462
* Make sure we update the static local decl address map when we are forced to ↵Eli Friedman2012-03-092-6/+8
| | | | | | rebuild a global because of the initializer. <rdar://problem/10957867>. llvm-svn: 152372
* Make sure constant emission handles initializer lists with strings ↵Eli Friedman2012-03-091-1/+3
| | | | | | correctly. Part of <rdar://problem/10957867>. llvm-svn: 152370
* [AST] Reduce Decl::getASTContext() calls.Daniel Dunbar2012-03-091-1/+1
| | | | | | | - This function is not at all free; pass it around along some hot paths instead of recomputing it deep inside various VarDecl methods. llvm-svn: 152363
* Replace MarkVarRequired with a more genericRafael Espindola2012-03-084-10/+13
| | | | | | HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios. llvm-svn: 152320
* Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:Stepan Dyatkovskiy2012-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*". ConstCaseIt is just a read-only iterator. CaseIt is read-write iterator; it allows to change case successor and case value. Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters. Main way of iterator usage looks like this: SwitchInst *SI = ... // intialize it somehow for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) { BasicBlock *BB = i.getCaseSuccessor(); ConstantInt *V = i.getCaseValue(); // Do something. } If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method. If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method. There are also related changes in llvm-clients: klee and clang. llvm-svn: 152298
* AST representation for user-defined literals, plus just enough of semanticRichard Smith2012-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | | analysis to make the AST representation testable. They are represented by a new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic properties, including full CodeGen support, are achieved for free by this representation. UserDefinedLiterals can never be dependent, so no custom instantiation behavior is required. They are mangled as if they were direct calls to the underlying literal operator. This matches g++'s apparent behavior (but not its actual mangling, which is broken for literal-operator-ids). User-defined *string* literals are now fully-operational, but the semantic analysis is quite hacky and needs more work. No other forms of user-defined literal are created yet, but the AST support for them is present. This patch committed after midnight because we had already hit the quota for new kinds of literal yesterday. llvm-svn: 152211
* Don't even try to directly emit the value of a DeclRefExpr if that declarationRichard Smith2012-03-071-2/+11
| | | | | | is not usable in a constant expression. ~2.5% speedup on 403.gcc / combine.c. llvm-svn: 152193
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-066-20/+279
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* Fix a small difference in sema and codegen views of what needs to be output.Rafael Espindola2012-03-054-0/+16
| | | | | | | | | | | | 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
* Silence a GCC warning about a set-but-not-used variable in release builds.Chandler Carruth2012-03-041-0/+1
| | | | llvm-svn: 152005
* add a testcase for PR12094 and fix a crash on pointer to incomplete type,Chris Lattner2012-03-041-3/+7
| | | | | | reported by Richard Smith. llvm-svn: 151993
* Reinstate r151879, r151880, reverted in r151922, along with a bugfix forRichard Smith2012-03-024-30/+49
| | | | | | | | | 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
* PR12094: Set the alignment of memory intrinsic instructions based on theJay Foad2012-03-022-29/+57
| | | | | | types of the pointer arguments. llvm-svn: 151927
* Revert r151879, r151880, "PR12145: Avoid emitting loads of constexpr ↵Daniel Dunbar2012-03-021-15/+9
| | | | | | | | variables in contexts where there" and "Fix buildbot: make this test less dependent on the value names in the produced IR." They broke bootstrap. llvm-svn: 151922
* PR12145: Avoid emitting loads of constexpr variables in contexts where thereRichard Smith2012-03-021-9/+15
| | | | | | | is no odr-use of the variable. Go slightly beyond what the standard requires for variables of reference type. llvm-svn: 151879
* Make CodeGenFunction::EmitBlockCopyAndAutorelease actually do what its name ↵Eli Friedman2012-03-011-4/+4
| | | | | | says. llvm-svn: 151853
* Add a flag -fthread-sanitizer.Kostya Serebryany2012-03-011-1/+13
| | | | | | | | | | This flag enables ThreadSanitizer instrumentation committed to llvm as r150423. The patch includes one test for -fthread-sanitizer and one similar test for -faddress-sanitizer. This patch does not modify the linker flags (as we do it for -faddress-sanitizer) because the run-time library is not yet committed and it's structure in compiler-rt is not 100% clear. The users manual wil be changed in a separate commit. llvm-svn: 151846
* Reapply r151702 with a small fix for a failure to cut and pasteEric Christopher2012-03-011-30/+61
| | | | | | | | correctly. Still rdar://10900684 llvm-svn: 151838
* Implement "optimization" for lambda-to-block conversion which inlines the ↵Eli Friedman2012-03-014-11/+19
| | | | | | | | generated block literal for lambdas which are immediately converted to block pointer type. This simplifies the AST, avoids an unnecessary copy of the lambda and makes it much easier to avoid copying the result onto the heap. Note that this transformation has a substantial semantic effect outside of ARC: it gives the converted lambda lifetime semantics similar to a block literal. With ARC, the effect is much less obvious because the lifetime of blocks is already managed. llvm-svn: 151797
* Allocate TargetLibraryInfo for the CodeGen passes. Otherwise, it's instantiatedChad Rosier2012-02-291-0/+6
| | | | | | | | | by the BAA pass, which uses the default TargetLibraryInfo constructor. Unfortunately, the default TargetLibraryInfo constructor assumes all library calls are available and thus ignores -fno-builtin. rdar://10947759 llvm-svn: 151745
* Revert r151702, "Add support for handling captured variables in lambda debugDaniel Dunbar2012-02-291-61/+30
| | | | | | info.", which broke some -O0 -g tests. llvm-svn: 151730
* Add support for handling captured variables in lambda debug info.Eric Christopher2012-02-291-30/+61
| | | | | | | | | | | | This currently doesn't handle capturing the 'this' pointer for any enclosing class. Steal the lambda-expressions.cpp testcase and debugify it and try to use more variables to proof it against random changes. Part of rdar://10900684 llvm-svn: 151702
* Formatting.Eric Christopher2012-02-291-1/+1
| | | | llvm-svn: 151700
OpenPOWER on IntegriCloud