summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Make EmitAggregateCopy take an alignment argument. Make EmitFinalDestCopy ↵Eli Friedman2011-12-052-7/+15
| | | | | | | | | | | pass in the correct alignment when known. The test includes a FIXME for a related case involving calls; it's a bit more complicated to fix because the RValue class doesn't keep track of alignment. <rdar://problem/10463337> llvm-svn: 145862
* Switch LValue so that it exposes alignment in CharUnits. (No functional ↵Eli Friedman2011-12-0310-50/+45
| | | | | | change.) llvm-svn: 145753
* Add a utility to get a RValue for a given LValue for an aggregate; switch a ↵Eli Friedman2011-12-033-7/+9
| | | | | | few places over to it. llvm-svn: 145747
* Switch the Alignment argument on AggValueSlot over to CharUnits, per John's ↵Eli Friedman2011-12-037-20/+17
| | | | | | review comment. llvm-svn: 145741
* Track alignment in AggValueSlot. No functional change in this patch, but ↵Eli Friedman2011-12-037-30/+59
| | | | | | I'll be introducing uses of the specified alignment soon. llvm-svn: 145736
* Introduce a module import declaration, so that we properly represent, e.g.,Douglas Gregor2011-12-022-0/+2
| | | | | | | | __import_module__ std.vector; in the AST. llvm-svn: 145725
* Update for change to LLVM TargetMachine API in r145714.Nick Lewycky2011-12-021-34/+37
| | | | llvm-svn: 145715
* Fix wrong-code bug when a const automatic variable of struct type has both aRichard Smith2011-12-021-7/+10
| | | | | | | | | | | | mutable member and a constant initializer. We'd previously promoted such variables to global constants, resulting in nasal demons if the mutable member was modified. This is only a temporary fix. The subtle interplay between isConstantInitializer and CGExprConstant is very bug-prone; there are some other issues in this area which I will be addressing in subsequent, more major reworking of this code. llvm-svn: 145654
* When we're passing a vector with an illegal type through memory on x86-64, ↵Eli Friedman2011-12-021-7/+27
| | | | | | use byval so we're sure the backend does the right thing. Fixes va_arg with illegal vectors and an obscure ABI mismatch with __m64 vectors. llvm-svn: 145652
* Fix -forwardingTargetForSelector: (GNUstep runtime) which was broken for theDavid Chisnall2011-12-011-0/+2
| | | | | | old dispatch mechanism when I introduced the new one. llvm-svn: 145609
* Don't use a varargs convention for calls unprototyped functions where one of ↵Eli Friedman2011-12-013-7/+27
| | | | | | the arguments is an AVX vector. llvm-svn: 145574
* Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor2011-11-301-1/+1
| | | | | | | | | library, since modules cut across all of the libraries. Rename serialization::Module to serialization::ModuleFile to side-step the annoying naming conflict. Prune a bunch of ModuleMap.h includes that are no longer needed (most files only needed the Module type). llvm-svn: 145538
* make asan work at -O0, clang part. Patch by glider@google.comKostya Serebryany2011-11-301-0/+2
| | | | llvm-svn: 145531
* Add bigger method type encodings to protocol objects. <rdar://problem/10492418>Bob Wilson2011-11-301-13/+70
| | | | | | | | | | | | | | | | | | The new metadata are method @encode strings with additional data. 1. Each Objective-C object is marked with its class name and protocol names. The same is done for property @encode already. 2. Each block object is marked with its function prototype's @encoding. For example, a method parameter that is a block object that itself returns void and takes an int would look like: @?<v@?i> These new method @encode strings are stored in a single array pointed to by structs protocol_t and objc_protocol_ext. Patch provided by Greg Parker! llvm-svn: 145469
* Make sure that forward declarations are marked as such in the debug infoEric Christopher2011-11-291-1/+2
| | | | | | | | for the structure type. rdar://10499337 llvm-svn: 145461
* The cheap version of getName() is sufficient here.Benjamin Kramer2011-11-291-1/+1
| | | | llvm-svn: 145399
* The _setjmp builtin library function should have the "returns twice"Bill Wendling2011-11-291-1/+2
| | | | | | | | attribute. This prevents the stack slot allocator from coming along and using a stack which it thinks is available but isn't. <rdar://problem/10492556> llvm-svn: 145332
* Correct the code generation for function arguments of vec3 types on x86_64 ↵Tanya Lattner2011-11-281-1/+1
| | | | | | | | when they are greater than 128 bits. This was incorrectly coercing things like long3 into a double2. Add test case. llvm-svn: 145312
* Another silly workaround for MSVC.Peter Collingbourne2011-11-281-1/+3
| | | | llvm-svn: 145227
* Sigh, another workaround for MSVC.Peter Collingbourne2011-11-281-1/+1
| | | | llvm-svn: 145211
* Work around a gcc4.2 bug.Peter Collingbourne2011-11-281-1/+1
| | | | llvm-svn: 145209
* When destroying temporaries, instead of a custom cleanup use thePeter Collingbourne2011-11-276-41/+12
| | | | | | | | | | | 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
* Add inreg attributes to reference arguments.Rafael Espindola2011-11-271-1/+2
| | | | llvm-svn: 145189
* 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-223-0/+15
| | | | | | appear in non-constant initializers in C++. llvm-svn: 145087
* implement __has_feature(address_sanitizer); also use ↵Kostya Serebryany2011-11-221-1/+1
| | | | | | LangOpts.AddressSanitizer instead of CodeGenOpts.AddressSanitizer llvm-svn: 145054
* CodeGen: Simplify code.Benjamin Kramer2011-11-211-6/+3
| | | | llvm-svn: 145040
* CodeGen: allow __asm renaming on static local variables.Benjamin Kramer2011-11-201-1/+9
| | | | | | Fixes PR4777. llvm-svn: 145015
* Finish r144971, which was an incomplete commit.Eli Friedman2011-11-181-1/+1
| | | | llvm-svn: 144972
* Fix the meaning of an "empty" record for the case of a zero-length array. ↵Eli Friedman2011-11-181-3/+7
| | | | | | Use isEmptyRecord for arguments on x86-32; there are structs of size 0 which don't count as empty. llvm-svn: 144971
* Make va_arg on x86-64 compute alignment the same way as argument passing.Eli Friedman2011-11-181-7/+5
| | | | | | Fixes <rdar://problem/10463281>. llvm-svn: 144966
* A bunch of fixes to argument passing and va_arg on Darwin x86-32 for ↵Eli Friedman2011-11-181-3/+21
| | | | | | structures containing an SSE vector. llvm-svn: 144963
* Don't try to expand struct arguments containing holes on x86-32. From gcc ↵Eli Friedman2011-11-181-0/+8
| | | | | | struct layout tests. llvm-svn: 144961
* Simplify code for returning a struct for Darwin x86-32 ABI. Use a better ↵Eli Friedman2011-11-181-41/+16
| | | | | | type for a function returning a struct containing only a pointer. Handle the edge case of a struct containing only a float or double plus some dead padding instead of asserting. llvm-svn: 144960
* Ignore empty unions in argument lowering on x86-32. From gcc struct layout ↵Eli Friedman2011-11-181-2/+2
| | | | | | tests. llvm-svn: 144944
* Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continueArgyrios Kyrtzidis2011-11-182-2/+5
| | | | | | parsing or false to abort parsing. llvm-svn: 144943
* Use the canonical decl to index so that we can really find it later.Eric Christopher2011-11-171-4/+4
| | | | | | Fixes rdar://10433202 llvm-svn: 144938
* Constant expression evaluation: add support for evaluation of member pointersRichard Smith2011-11-171-0/+1
| | | | | | and base-to-derived casts, and add proper handling of temporaries. llvm-svn: 144926
* Add -f[no-]address-sanitizer flagKostya Serebryany2011-11-161-0/+10
| | | | llvm-svn: 144800
* Match LLVM API change.Evan Cheng2011-11-161-9/+10
| | | | llvm-svn: 144789
* Fix a bunch of really nasty bugs in how we compute alignment for reference ↵Eli Friedman2011-11-162-14/+37
| | | | | | lvalues. PR11376. llvm-svn: 144745
* Fix crash in calling convention code expanding an struct with a complex member.Eli Friedman2011-11-151-3/+9
| | | | llvm-svn: 144612
* Fixup comment.Eric Christopher2011-11-141-1/+1
| | | | llvm-svn: 144548
* Represent an APValue based on a Decl as that Decl, rather than a DeclRefExprRichard Smith2011-11-121-22/+23
| | | | | | | | or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to static member functions and static data members are now emitted as constant expressions. llvm-svn: 144468
* Add invariant.load metadata to loads from selector references. Allows these ↵Pete Cooper2011-11-101-1/+6
| | | | | | loads to later be moved/combined in the optimizer. Fixes <rdar://problem/6027699> llvm-svn: 144318
* Add missing dependency for shared library build to CMakeLists. Patch by ↵Eli Friedman2011-11-101-0/+1
| | | | | | Johannes Obermayr. llvm-svn: 144310
* Whenever explicitly activating or deactivating a cleanup, weJohn McCall2011-11-107-32/+93
| | | | | | | | | | need to provide a 'dominating IP' which is guaranteed to dominate the (de)activation point but which cannot be avoided along any execution path from the (de)activation point to the push-point of the cleanup. Using the entry block is bad mojo. llvm-svn: 144276
* Fix a subtle bug with cleanups: when activatingJohn McCall2011-11-101-9/+14
| | | | | | | | | | | | a previously-inactive cleanup, not only do we need a flag variable, but we should also force the cleanup to query the flag variable. However, we only need to do this when we're activating in a context that's conditionally executed; otherwise, we may safely assume that the cleanup is dominated by the activation point. llvm-svn: 144271
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-1011-76/+223
| | | | | | | | | | | | 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
* Constant expression evaluation: support for evaluation of structs and unions ofRichard Smith2011-11-101-2/+3
| | | | | | | literal types, as well as derived-to-base casts for lvalues and derived-to-virtual-base casts. llvm-svn: 144265
OpenPOWER on IntegriCloud