summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* fix my containsBreak predicate.Chris Lattner2011-02-281-0/+3
| | | | llvm-svn: 126600
* Add some helper methods that will be used in my next patch.Chris Lattner2011-02-281-4/+42
| | | | llvm-svn: 126596
* Change the interface to ConstantFoldsToSimpleInteger to not encode Chris Lattner2011-02-271-13/+22
| | | | | | a bool + success into one tri-state integer, simplifying things. llvm-svn: 126592
* Add a LangOptions::areExceptionsEnabled and start using it.Anders Carlsson2011-02-201-2/+1
| | | | llvm-svn: 126062
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-0/+27
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-171-1/+1
| | | | | | | | | | | | | | | | | | | LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
* Assorted cleanup:John McCall2011-02-151-10/+2
| | | | | | | | | - 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
* OpenCL: add support for __kernel, kernel keywords and EXTENSION,Peter Collingbourne2011-02-141-0/+13
| | | | | | FP_CONTRACT pragmas. Patch originally by ARM. llvm-svn: 125475
* Give some convenient idiomatic accessors to Stmt::child_range andJohn McCall2011-02-131-2/+1
| | | | | | | Stmt::const_child_range, then make a bunch of places use them instead of the individual iterator accessors. llvm-svn: 125450
* IRgen: Fix an immediate-exit-from-fn style nit.Daniel Dunbar2011-02-101-5/+4
| | | | llvm-svn: 125289
* Implement mcount profiling, enabled via -pg.Roman Divacky2011-02-101-0/+12
| | | | llvm-svn: 125282
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-8/+6
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* Do the right thing for zero-initializing VLAs that don't have a zeroJohn McCall2011-02-011-5/+60
| | | | | | | bit-pattern. It's not clear that this is actually useful given current language restrictions. llvm-svn: 124685
* Move all the cleanups framework code into a single file.John McCall2011-01-281-886/+0
| | | | | | Pure motion. llvm-svn: 124484
* Better framework for conditional cleanups; untested as yet.John McCall2011-01-261-5/+18
| | | | | | | | I'm separately committing this because it incidentally changes some block orderings and minor IR issues, like using a phi instead of an unnecessary alloca. llvm-svn: 124277
* Support the zero-initialization of VLAs when that really means a zeroJohn McCall2011-01-141-8/+20
| | | | | | | bit-pattern. Continue punting on zero-initializing VLAs with a nonzero pattern. llvm-svn: 123439
* When simplifying a cleanup's entry by merging it into a single predecessor,John McCall2011-01-141-0/+4
| | | | | | | | replace all uses of the entry with the predecessor. There are no cleanups relying on this right now, but if we ever want a cleanup with a phi inside it, this will be important. llvm-svn: 123438
* Simplify mem{cpy, move, set} creation with IRBuilder.Benjamin Kramer2010-12-301-13/+6
| | | | llvm-svn: 122634
* Restore r121752 without modification.John McCall2010-12-141-5/+6
| | | | llvm-svn: 121763
* Pull out r121752 in case it's causing the selfhost breakage.John McCall2010-12-141-6/+5
| | | | llvm-svn: 121759
* Factor out most of the extra state in a FunctionProtoType into a separateJohn McCall2010-12-141-5/+6
| | | | | | | class to be passed around. The line between argument and return types and everything else is kindof vague, but I think it's justifiable. llvm-svn: 121752
* Added ParenType type node.Abramo Bagnara2010-12-101-0/+5
| | | | llvm-svn: 121488
* Use CodeGenFunction's getContext(), for consistency.Dan Gohman2010-10-291-1/+1
| | | | llvm-svn: 117734
* Permit constant evaluation of const floating-point variables withJohn McCall2010-10-091-1/+1
| | | | | | constant initializers. llvm-svn: 116138
* Remove unused argument.Devang Patel2010-10-061-1/+1
| | | | llvm-svn: 115789
* Teach PopCleanupBlock to correctly handle the possibility of branching throughJohn McCall2010-10-051-9/+14
| | | | | | | a EH-only cleanup as part of a fallthrough branch-through. That this happens for this test case is actually a separate bug. llvm-svn: 115668
* If we're resolving all outstanding fixups, and there are multiple fixupsJohn McCall2010-10-051-3/+4
| | | | | | | | | for the same destination, then we must potentially rewrite the initial branch of every fixup. Without this patch, a short-circuit check meant to prevent a switch case from being redundantly added was preventing later fixups from being processed. Fixes PR8175 (again). llvm-svn: 115586
* Patch implements passing arrays to functions expectingFariborz Jahanian2010-09-241-0/+3
| | | | | | vla. Implements pr7827. llvm-svn: 114737
* Adjust a fixup's starting branch if it's being resolved becauseJohn McCall2010-09-181-6/+29
| | | | | | | it reached the outermost scope and it hasn't yet been forwarded to a cleanup. Fixed PR8175. llvm-svn: 114259
* When emitting a new-expression inside a conditional expression,John McCall2010-09-171-11/+14
| | | | | | | | | | | | | | | | the cleanup might not be dominated by the allocation code. In this case, we have to store aside all the delete arguments in case we need them later. There's room for optimization here in cases where we end up not actually needing the cleanup in different branches (or being able to pop it after the initialization code). Also make sure we only call this operator delete along the path where we actually allocated something. Fixes rdar://problem/8439196. llvm-svn: 114145
* Implement the EH cleanup to call 'operator delete' if a new-expression throwsJohn McCall2010-09-141-82/+260
| | | | | | (but not if destructors associated with the full-expression throw). llvm-svn: 113836
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-39/+8
| | | | | | under the ARM ABI. llvm-svn: 112588
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-3/+3
| | | | | | to the new constants. llvm-svn: 112047
* Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall2010-08-221-2/+1
| | | | | | | | | 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
* Experiment with using first-class aggregates to represent member functionJohn McCall2010-08-221-1/+1
| | | | | | | | | | pointers. I find the resulting code to be substantially cleaner, and it makes it very easy to use the same APIs for data member pointers (which I have conscientiously avoided here), and it avoids a plethora of potential inefficiencies due to excessive memory copying, but we'll have to see if it actually works. llvm-svn: 111776
* Abstract more member-pointerness out.John McCall2010-08-221-1/+2
| | | | llvm-svn: 111771
* More cleanup enabling.John McCall2010-08-141-12/+20
| | | | llvm-svn: 111070
* Sketch out a framework for delaying the activation of a cleanup.John McCall2010-08-131-0/+67
| | | | | | Not yet complete or used. llvm-svn: 111044
* Revise r110163: don't mark weak functions nounwind, because the optimizerJohn McCall2010-08-111-0/+4
| | | | | | treats that as a contract to be fulfilled by any replacements. llvm-svn: 110864
* IRGen support for functions returning objc objectFariborz Jahanian2010-08-111-1/+1
| | | | | | types. Fixes PR7865. llvm-svn: 110832
* Simplify code and add comments, in code that generate debug info for ↵Devang Patel2010-08-101-11/+4
| | | | | | constant integer globals, based on Chris's feedback. llvm-svn: 110694
* Even if a constant's evaluated value is used, emit debug info for the ↵Devang Patel2010-08-101-0/+14
| | | | | | constant variable. llvm-svn: 110660
* Inline a special case of EmitAggregateCopy into EmitNullInitializationJohn McCall2010-08-071-27/+41
| | | | | | | | | to avoid the awesome-but-wrong-in-this-case assertion in the canon EAC. Fixes PR7834. Also fix a subtle address-space bug in the memset path. llvm-svn: 110511
* Do a very simple pass over every function we emit to infer whether we canJohn McCall2010-08-031-0/+18
| | | | | | | mark it nounwind based on whether it contains any non-nounwind calls. <rdar://problem/8087431> llvm-svn: 110163
* When creating a jump destination, its scope should be the scope of theJohn McCall2010-07-281-0/+3
| | | | | | | | | enclosing normal cleanup, not the top of the EH stack. I'm *really* surprised this hasn't been causing more problems. Fixes rdar://problem/8231514. llvm-svn: 109569
* Test for the presence of EH branch-throughs instead of normal branch-throughs.John McCall2010-07-261-1/+1
| | | | | | I knew this code duplication would bite me. llvm-svn: 109463
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-8/+0
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Revise cleanup IR generation to fix a major bug with cleanups (PR7686)John McCall2010-07-231-236/+449
| | | | | | | as well as some significant asymptotic inefficiencies with threading multiple jumps through deep cleanups. llvm-svn: 109274
* Keep track of artificial scopes introduced by line directives. For example,Devang Patel2010-07-221-1/+1
| | | | | | | | | | | | #line 41 "bar.c" dummy (1, i); #line 24 "bar.h" i = f2 (i); #line 44 "bar.c" This is tested by step-line.exp in gdb testsuite. llvm-svn: 109189
* Rename LazyCleanup -> Cleanup. No functionality change for these last threeJohn McCall2010-07-211-47/+42
| | | | | | commits. llvm-svn: 109000
OpenPOWER on IntegriCloud