summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash on C++ code when compiling with -finstrument-functions.Ted Kremenek2011-05-161-1/+1
| | | | llvm-svn: 131435
* Make CGF.getContext() inlinable, because it's trivial, and optimizeJohn McCall2011-05-151-7/+35
| | | | | | hasAggregateLLVMType. llvm-svn: 131375
* Eliminate some literal 8s from EmitNullInitialization() by convertingKen Dyck2011-04-221-7/+9
| | | | | | variables to CharUnits. No change in functionality intended. llvm-svn: 130001
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-211-1/+1
| | | | llvm-svn: 129929
* C1X: implement generic selectionsPeter Collingbourne2011-04-151-2/+1
| | | | | | | As an extension, generic selection support has been added for all supported languages. The syntax is the same as for C1X. llvm-svn: 129554
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-301-3/+3
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128538
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-15/+8
| | | | | | | | | | 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-3/+3
| | | | | | 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
* Initialize variable.Bill Wendling2011-03-041-2/+2
| | | | llvm-svn: 127039
* Revert "Add CC_Win64ThisCall and set it in the necessary places."Tilmann Scheller2011-03-021-4/+3
| | | | | | This reverts commit 126863. llvm-svn: 126886
* Add CC_Win64ThisCall and set it in the necessary places.Tilmann Scheller2011-03-021-3/+4
| | | | llvm-svn: 126863
* 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
OpenPOWER on IntegriCloud