aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
AgeCommit message (Collapse)AuthorFilesLines
2011-04-22Eliminate some literal 8s from EmitNullInitialization() by convertingKen Dyck1-7/+9
variables to CharUnits. No change in functionality intended. llvm-svn: 130001
2011-04-21PR9214: Convert Metadata API to use ArrayRef.Jay Foad1-1/+1
llvm-svn: 129929
2011-04-15C1X: implement generic selectionsPeter Collingbourne1-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
2011-03-30Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad1-3/+3
PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128538
2011-03-09Use the "undergoes default argument promotion" bit on parameters toJohn McCall1-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
2011-03-07DebugInfo can be enabled or disabled at function level (e.g. using an ↵Devang Patel1-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
2011-03-04Initialize variable.Bill Wendling1-2/+2
llvm-svn: 127039
2011-03-02Revert "Add CC_Win64ThisCall and set it in the necessary places."Tilmann Scheller1-4/+3
This reverts commit 126863. llvm-svn: 126886
2011-03-02Add CC_Win64ThisCall and set it in the necessary places.Tilmann Scheller1-3/+4
llvm-svn: 126863
2011-02-28fix my containsBreak predicate.Chris Lattner1-0/+3
llvm-svn: 126600
2011-02-28Add some helper methods that will be used in my next patch.Chris Lattner1-4/+42
llvm-svn: 126596
2011-02-27Change the interface to ConstantFoldsToSimpleInteger to not encode Chris Lattner1-13/+22
a bool + success into one tri-state integer, simplifying things. llvm-svn: 126592
2011-02-20Add a LangOptions::areExceptionsEnabled and start using it.Anders Carlsson1-2/+1
llvm-svn: 126062
2011-02-17Change the representation of GNU ?: expressions to use a different expressionJohn McCall1-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
2011-02-17Step #1/N of implementing support for __label__: split labels intoChris Lattner1-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
2011-02-15Assorted cleanup:John McCall1-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
2011-02-14OpenCL: add support for __kernel, kernel keywords and EXTENSION,Peter Collingbourne1-0/+13
FP_CONTRACT pragmas. Patch originally by ARM. llvm-svn: 125475
2011-02-13Give some convenient idiomatic accessors to Stmt::child_range andJohn McCall1-2/+1
Stmt::const_child_range, then make a bunch of places use them instead of the individual iterator accessors. llvm-svn: 125450
2011-02-10IRgen: Fix an immediate-exit-from-fn style nit.Daniel Dunbar1-5/+4
llvm-svn: 125289
2011-02-10Implement mcount profiling, enabled via -pg.Roman Divacky1-0/+12
llvm-svn: 125282
2011-02-08Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall1-8/+6
Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
2011-02-01Do the right thing for zero-initializing VLAs that don't have a zeroJohn McCall1-5/+60
bit-pattern. It's not clear that this is actually useful given current language restrictions. llvm-svn: 124685
2011-01-28Move all the cleanups framework code into a single file.John McCall1-886/+0
Pure motion. llvm-svn: 124484
2011-01-26Better framework for conditional cleanups; untested as yet.John McCall1-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
2011-01-14Support the zero-initialization of VLAs when that really means a zeroJohn McCall1-8/+20
bit-pattern. Continue punting on zero-initializing VLAs with a nonzero pattern. llvm-svn: 123439
2011-01-14When simplifying a cleanup's entry by merging it into a single predecessor,John McCall1-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
2010-12-30Simplify mem{cpy, move, set} creation with IRBuilder.Benjamin Kramer1-13/+6
llvm-svn: 122634
2010-12-14Restore r121752 without modification.John McCall1-5/+6
llvm-svn: 121763
2010-12-14Pull out r121752 in case it's causing the selfhost breakage.John McCall1-6/+5
llvm-svn: 121759
2010-12-14Factor out most of the extra state in a FunctionProtoType into a separateJohn McCall1-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
2010-12-10Added ParenType type node.Abramo Bagnara1-0/+5
llvm-svn: 121488
2010-10-29Use CodeGenFunction's getContext(), for consistency.Dan Gohman1-1/+1
llvm-svn: 117734
2010-10-09Permit constant evaluation of const floating-point variables withJohn McCall1-1/+1
constant initializers. llvm-svn: 116138
2010-10-06Remove unused argument.Devang Patel1-1/+1
llvm-svn: 115789
2010-10-05Teach PopCleanupBlock to correctly handle the possibility of branching throughJohn McCall1-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
2010-10-05If we're resolving all outstanding fixups, and there are multiple fixupsJohn McCall1-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
2010-09-24Patch implements passing arrays to functions expectingFariborz Jahanian1-0/+3
vla. Implements pr7827. llvm-svn: 114737
2010-09-18Adjust a fixup's starting branch if it's being resolved becauseJohn McCall1-6/+29
it reached the outermost scope and it hasn't yet been forwarded to a cleanup. Fixed PR8175. llvm-svn: 114259
2010-09-17When emitting a new-expression inside a conditional expression,John McCall1-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
2010-09-14Implement the EH cleanup to call 'operator delete' if a new-expression throwsJohn McCall1-82/+260
(but not if destructors associated with the full-expression throw). llvm-svn: 113836
2010-08-31Teach IR generation to return 'this' from constructors and destructorsJohn McCall1-39/+8
under the ARM ABI. llvm-svn: 112588
2010-08-25GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall1-3/+3
to the new constants. llvm-svn: 112047
2010-08-22Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall1-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
2010-08-22Experiment with using first-class aggregates to represent member functionJohn McCall1-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
2010-08-22Abstract more member-pointerness out.John McCall1-1/+2
llvm-svn: 111771
2010-08-14More cleanup enabling.John McCall1-12/+20
llvm-svn: 111070
2010-08-13Sketch out a framework for delaying the activation of a cleanup.John McCall1-0/+67
Not yet complete or used. llvm-svn: 111044
2010-08-11Revise r110163: don't mark weak functions nounwind, because the optimizerJohn McCall1-0/+4
treats that as a contract to be fulfilled by any replacements. llvm-svn: 110864
2010-08-11IRGen support for functions returning objc objectFariborz Jahanian1-1/+1
types. Fixes PR7865. llvm-svn: 110832
2010-08-10Simplify code and add comments, in code that generate debug info for ↵Devang Patel1-11/+4
constant integer globals, based on Chris's feedback. llvm-svn: 110694