summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Track alignment in AggValueSlot. No functional change in this patch, but ↵Eli Friedman2011-12-031-6/+11
| | | | | | I'll be introducing uses of the specified alignment soon. llvm-svn: 145736
* Don't use a varargs convention for calls unprototyped functions where one of ↵Eli Friedman2011-12-011-1/+1
| | | | | | the arguments is an AVX vector. llvm-svn: 145574
* When destroying temporaries, instead of a custom cleanup use thePeter Collingbourne2011-11-271-1/+1
| | | | | | | | | | | generic pushDestroy function. This would reduce the number of useful declarations in CGTemporaries.cpp to one. Since CodeGenFunction::EmitCXXTemporary does not deserve its own file, move it to CGCleanup.cpp and delete CGTemporaries.cpp. llvm-svn: 145202
* Reference initialization with initializer lists.Sebastian Redl2011-11-271-1/+12
| | | | | | This supports single-element initializer lists for references according to DR1288, as well as creating temporaries and binding to them for other initializer lists. llvm-svn: 145186
* Use static storage duration for file-scope compound literals, even when theyRichard Smith2011-11-221-0/+5
| | | | | | appear in non-constant initializers in C++. llvm-svn: 145087
* Fix a bunch of really nasty bugs in how we compute alignment for reference ↵Eli Friedman2011-11-161-14/+28
| | | | | | lvalues. PR11376. llvm-svn: 144745
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-101-4/+11
| | | | | | | | | | | | full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
* Bind function "r-values" as l-values when emitting them asJohn McCall2011-11-081-1/+1
| | | | | | opaque values. Silly C type system. llvm-svn: 144144
* Rip out CK_GetObjCProperty.John McCall2011-11-071-2/+0
| | | | llvm-svn: 143910
* Rip the ObjCPropertyRef l-value kind out of IR-generation.John McCall2011-11-071-35/+8
| | | | llvm-svn: 143908
* Change the AST representation of operations on Objective-CJohn McCall2011-11-061-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* back out changes in r143399 and r143475.Fariborz Jahanian2011-11-021-3/+1
| | | | | | | rvale-references are captured by reference in blocks. // rdar://9971124. llvm-svn: 143583
* Adds IRGen support for captured rvalue references in blocks.Fariborz Jahanian2011-10-311-1/+3
| | | | | | | In this case, temporary value is copied into block descriptor as their own copy to work on. // rdar://9971124 llvm-svn: 143399
* Annotate imprecise FP division with fpaccuracy metadataPeter Collingbourne2011-10-271-0/+16
| | | | | | | | | The OpenCL single precision division operation is only required to be accurate to 2.5ulp. Annotate the fdiv instruction with metadata which signals to the backend that an imprecise divide instruction may be used. llvm-svn: 143136
* Misc fixes for atomics. Biggest fix is doing alignment correctly for ↵Eli Friedman2011-10-141-8/+6
| | | | | | _Atomic types. llvm-svn: 142002
* Recommit:Eric Christopher2011-10-131-4/+2
| | | | | | | | | | | | | | | 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-2/+4
| | | | llvm-svn: 141796
* Start handling debug line and scope information better:Eric Christopher2011-10-111-4/+2
| | | | | | | | | | | 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
* Silence some -Wuninitialized false positives with gcc.Eli Friedman2011-10-111-1/+2
| | | | llvm-svn: 141701
* Initial implementation of __atomic_* (everything except __atomic_is_lock_free).Eli Friedman2011-10-111-0/+277
| | | | llvm-svn: 141632
* CUDA: IR generation support for kernel call expressionsPeter Collingbourne2011-10-061-0/+3
| | | | llvm-svn: 141300
* objc gc: assigning to an objc object struct member through an ivar Fariborz Jahanian2011-09-301-8/+20
| | | | | | pointer to this struct must go through the none ivar writer barrier. llvm-svn: 140867
* Rename EmitStopPoint in CGDebugInfo to EmitLocation. "stop points" don'tEric Christopher2011-09-291-1/+1
| | | | | | exist anymore. llvm-svn: 140739
* Call UpdateLineDirectiveRegion every time we want to emit a stopEric Christopher2011-09-291-1/+0
| | | | | | | point in the code. Ensures that we don't miss any places and the check is reasonably cheap. llvm-svn: 140737
* de-tmpify clang.Benjamin Kramer2011-09-271-16/+16
| | | | llvm-svn: 140637
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-1/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-6/+7
| | | | llvm-svn: 140367
* ANSI C requires that a call to an unprototyped function type succeedJohn McCall2011-09-211-2/+30
| | | | | | | | | | | | | | | | | if the definition has a non-variadic prototype with compatible parameters. Therefore, the default rule for such calls must be to use a non-variadic convention. Achieve this by casting the callee to the function type with which it is required to be compatible, unless the target specifically opts out and insists that unprototyped calls should use the variadic rules. The only case of that I'm aware of is the x86-64 convention, which passes arguments the same way in both cases but also sets a small amount of extra information; here we seek to maintain compatibility with GCC, which does set this when calling an unprototyped function. Addresses PR10810 and PR10713. llvm-svn: 140241
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-3/+3
| | | | | | | | | | 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
* Rename the ARC cast kinds to start with "ARC".John McCall2011-09-101-4/+4
| | | | llvm-svn: 139466
* When converting a block pointer to an Objective-C pointer type, extendJohn McCall2011-09-101-1/+2
| | | | | | | | | | | the lifetime of the block by copying it to the heap, or else we'll get a dangling reference because the code working with the non-block-typed object will not know it needs to copy. There is some danger here, e.g. with assigning a block literal to an unsafe variable, but, well, it's an unsafe variable. llvm-svn: 139451
* Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: canJulien Lerouge2011-09-091-0/+3
| | | | | | | annotate global, local variables, struct fields, or arbitrary statements (using the __builtin_annotation), rdar://8037476. llvm-svn: 139423
* Give conversions of block pointers to ObjC pointers a different cast kindJohn McCall2011-09-091-1/+2
| | | | | | | | than conversions of C pointers to ObjC pointers. In order to ensure that we've caught every case, add asserts to CastExpr that strictly determine which cast kind is used for which kind of bit cast. llvm-svn: 139352
* Formatting.Eric Christopher2011-09-081-1/+2
| | | | llvm-svn: 139296
* When extracting the callee declaration from a call expression, be sureDouglas Gregor2011-09-061-8/+4
| | | | | | | | | | to look through SubstNonTypeTemplateParmExprs. Then, update the IR generation of CallExprs to actually use CallExpr::getCalleeDecl() rather than attempting to mimick its behavior (badly). Fixes <rdar://problem/10063539>. llvm-svn: 139185
* Slight optimization enabled by the previous assert: John McCall2011-08-261-2/+1
| | | | | | emit all gl-value arguments as reference bindings. llvm-svn: 138655
* What say we document some of these AggValueSlot flags a bitJohn McCall2011-08-261-1/+1
| | | | | | better. llvm-svn: 138628
* An initialization does not alias.John McCall2011-08-261-1/+2
| | | | llvm-svn: 138624
* Track whether an AggValueSlot is potentially aliased, and do notJohn McCall2011-08-251-1/+2
| | | | | | | | | | emit call results into potentially aliased slots. This allows us to properly mark indirect return slots as noalias, at the cost of requiring an extra memcpy when assigning an aggregate call result into a l-value. It also brings us into compliance with the x86-64 ABI. llvm-svn: 138599
* Use stronger typing for the flags on AggValueSlot and requireJohn McCall2011-08-251-2/+7
| | | | | | | creators to tell us whether something needs GC barriers. No functionality change. llvm-svn: 138581
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-14/+14
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad2011-07-221-2/+2
| | | | | | ArrayRef. llvm-svn: 135761
* as eli points out, we're not doing memory stuff here. While ConvertType Chris Lattner2011-07-201-1/+1
| | | | | | | and ConvertTypeForMem are the same for pointers, it is best to just use ConvertType. Thanks Eli! llvm-svn: 135567
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-13/+13
| | | | llvm-svn: 135370
* Create a new expression node, SubstNonTypeTemplateParmExpr,John McCall2011-07-151-0/+2
| | | | | | | | to represent a fully-substituted non-type template parameter. This should improve source fidelity, as well as being generically useful for diagnostics and such. llvm-svn: 135243
* Change intrinsic getter to take an ArrayRef, now that the underlying ↵Benjamin Kramer2011-07-141-3/+2
| | | | | | function in LLVM does. llvm-svn: 135155
* Add more compiler workarounds. Should fix the build with old GCCs and MSVC.Benjamin Kramer2011-07-121-6/+10
| | | | llvm-svn: 134995
* Switch field destruction over to use the new destroyer-based APIJohn McCall2011-07-121-17/+25
| | | | | | and kill a lot of redundant code. llvm-svn: 134988
* Work around a problem with a static helper's formulation in releaseChandler Carruth2011-07-121-5/+5
| | | | | | | | | | | | | | | builds introduced in r134972: lib/CodeGen/CGExpr.cpp:1294:7: error: no matching function for call to 'EmitBitCastOfLValueToProperType' lib/CodeGen/CGExpr.cpp:1278:1: note: candidate function not viable: no known conversion from 'CGBuilderTy' (aka 'IRBuilder<false>') to 'llvm::IRBuilder<> &' for 1st argument This fixes the issue by passing CodeGenFunction on down, and using its builder directly rather than passing just the builder down. This may not be the best / cleanest fix, Chris please review. It at least fixes builds. llvm-svn: 134977
* Fix a problem Eli ran into where we now reject incomplete arrays of Chris Lattner2011-07-121-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | uncompleted struct types. We now do what llvm-gcc does and compile them into [i8 x 0]. If the type is later completed, we make sure that it is appropriately cast. We compile the terrible example to something like this now: %struct.A = type { i32, i32, i32 } @g = external global [0 x i8] define void @_Z1fv() nounwind { entry: call void @_Z3fooP1A(%struct.A* bitcast ([0 x i8]* @g to %struct.A*)) ret void } declare void @_Z3fooP1A(%struct.A*) define %struct.A* @_Z2f2v() nounwind { entry: ret %struct.A* getelementptr inbounds ([0 x %struct.A]* bitcast ([0 x i8]* @g to [0 x %struct.A]*), i32 0, i64 1) } llvm-svn: 134972
OpenPOWER on IntegriCloud