summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement C++0x user-defined string literals.Alexis Hunt2010-08-291-0/+1
| | | | | | | | | | The extra data stored on user-defined literal Tokens is stored in extra allocated memory, which is managed by the PreprocessorLexer because there isn't a better place to put it that makes sure it gets deallocated, but only after it's used up. My testing has shown no significant slowdown as a result, but independent testing would be appreciated. llvm-svn: 112458
* Translate NEON vaddl, vaddw, vsubl, and vsubw builtins to llvm add/subBob Wilson2010-08-291-8/+26
| | | | | | | | with zext/sext operations, instead of to llvm intrinsics. (We can also get rid of the clang builtins and handle these entirely in the arm_neon.h header if there is a way to express vector sext/zext in C.) llvm-svn: 112413
* Debug info for friends!Devang Patel2010-08-272-13/+55
| | | | | | Patch originally by Alexander Herz. llvm-svn: 112275
* Add the new alignment arguments for NEON load/store intrinsics, based on theBob Wilson2010-08-271-3/+40
| | | | | | types of the pointer address expressions used with those intrinsics. llvm-svn: 112272
* improve comments.Chris Lattner2010-08-261-5/+2
| | | | llvm-svn: 112214
* fix 2xi16 to pass as i32 instead of <2 x i16>. The former passes inChris Lattner2010-08-261-0/+19
| | | | | | | memory (as required) the later now passes in an xmm register. This fixes gcc.dg/compat/vector_1 on x86-32. llvm-svn: 112211
* vector of long and ulong are also classified as INTEGER in x86-64 abi,Chris Lattner2010-08-261-1/+3
| | | | | | | this fixes rdar://8358475 a failure of the gcc.dg/compat/vector_1 abi test. llvm-svn: 112205
* 1 x ulonglong needs to be classified as INTEGER, just like 1 x longlong,Chris Lattner2010-08-261-1/+2
| | | | | | this fixes a miscompilation on the included testcase, rdar://8359248 llvm-svn: 112201
* Fix miscompilation. The cookie was not used when new'ing arrays with ↵Argyrios Kyrtzidis2010-08-261-4/+16
| | | | | | multiple dimensions. llvm-svn: 112188
* tame an assertion, fixing rdar://8357396Chris Lattner2010-08-261-1/+1
| | | | llvm-svn: 112174
* CGValue: Increase width of allowed alignment. We could switch to log2, but weDaniel Dunbar2010-08-261-1/+1
| | | | | | don't currently need the bits anyway. llvm-svn: 112173
* De-memberify the VarDecl and FunctionDecl StorageClass enums.John McCall2010-08-263-22/+22
| | | | | | This lets us remove Sema.h's dependency on Expr.h and Decl.h. llvm-svn: 112156
* IRgen/NEON: Fix codegen of vzip and vzipq.Daniel Dunbar2010-08-261-2/+2
| | | | | | - Will be adding an executable test case to test-suite repo. llvm-svn: 112126
* Finally pass "two floats in a 64-bit unit" as a <2 x float> instead ofChris Lattner2010-08-251-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as a double in the x86-64 ABI. This allows us to generate much better code for certain things, e.g.: _Complex float f32(_Complex float A, _Complex float B) { return A+B; } Used to compile into (look at the integer silliness!): _f32: ## @f32 ## BB#0: ## %entry movd %xmm1, %rax movd %eax, %xmm1 movd %xmm0, %rcx movd %ecx, %xmm0 addss %xmm1, %xmm0 movd %xmm0, %edx shrq $32, %rax movd %eax, %xmm0 shrq $32, %rcx movd %ecx, %xmm1 addss %xmm0, %xmm1 movd %xmm1, %eax shlq $32, %rax addq %rdx, %rax movd %rax, %xmm0 ret Now we get: _f32: ## @f32 movdqa %xmm0, %xmm2 addss %xmm1, %xmm2 pshufd $16, %xmm2, %xmm2 pshufd $1, %xmm1, %xmm1 pshufd $1, %xmm0, %xmm0 addss %xmm1, %xmm0 pshufd $16, %xmm0, %xmm1 movdqa %xmm2, %xmm0 unpcklps %xmm1, %xmm0 ret and compile stuff like: extern float _Complex ccoshf( float _Complex ) ; float _Complex ccosf ( float _Complex z ) { float _Complex iz; (__real__ iz) = -(__imag__ z); (__imag__ iz) = (__real__ z); return ccoshf(iz); } into: _ccosf: ## @ccosf ## BB#0: ## %entry pshufd $1, %xmm0, %xmm1 xorps LCPI4_0(%rip), %xmm1 unpcklps %xmm0, %xmm1 movaps %xmm1, %xmm0 jmp _ccoshf ## TAILCALL instead of: _ccosf: ## @ccosf ## BB#0: ## %entry movd %xmm0, %rax movq %rax, %rcx shlq $32, %rcx shrq $32, %rax xorl $-2147483648, %eax ## imm = 0xFFFFFFFF80000000 addq %rcx, %rax movd %rax, %xmm0 jmp _ccoshf ## TAILCALL There is still "stuff to be done" here for the struct case, but this resolves rdar://6379669 - [x86-64 ABI] Pass and return _Complex float / double efficiently llvm-svn: 112111
* Fix horrible white space errors.Michael J. Spencer2010-08-251-69/+69
| | | | llvm-svn: 112067
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-2510-146/+145
| | | | | | to the new constants. llvm-svn: 112047
* More incremental progress towards not including Expr.h in Sema.h.John McCall2010-08-252-2/+2
| | | | llvm-svn: 112044
* IRgen: Fix a horrible bug in pointer to bool conversion, which we were treatingDaniel Dunbar2010-08-251-2/+7
| | | | | | as a truncation not a comparison to null. llvm-svn: 112021
* Expression statements undergo lvalue-to-rvalue conversion in C,John McCall2010-08-251-2/+10
| | | | | | | | but not in C++, so don't emit aggregate loads of volatile references in null context in C++. Happens to have been caught by an assertion. We do not get the scalar case right. Volatiles are really broken. llvm-svn: 112019
* Fix 'for' loop variables' scope.Devang Patel2010-08-251-6/+6
| | | | llvm-svn: 112002
* Fix enum size and align. Tested by setvar.exp in gdb testsuite.Devang Patel2010-08-241-4/+6
| | | | llvm-svn: 111936
* Debug Info: Put full Clang version into the debug info, to make it easier toDaniel Dunbar2010-08-241-5/+1
| | | | | | identify what version of the compiler was used to build something. llvm-svn: 111927
* Emit debug info for enum constants.Devang Patel2010-08-232-32/+36
| | | | llvm-svn: 111852
* Reinstate the code for emitting an initial debug type for a struct,Dan Gohman2010-08-231-4/+11
| | | | | | | to handle the case where the struct is only forward-declared. In this case, a temporary MDNode is not needed and not desired. llvm-svn: 111842
* Support for IRGen of synthesize bitfield ivars inFariborz Jahanian2010-08-231-1/+10
| | | | | | objc-nonfragile-abi2 (radar 7824380). llvm-svn: 111823
* Emit an error noting that Clang does not support code generation forDouglas Gregor2010-08-231-1/+6
| | | | | | | the ternary operator without a left-hand side in C++ (PR7726), from Jean-Daniel Dupas! llvm-svn: 111809
* chandlerc pointed out that ending a line with /\ is not very friendly. :)John McCall2010-08-231-4/+4
| | | | llvm-svn: 111797
* fix rdar://8340348, a miscompile of boost that was exposed by r109848.Chris Lattner2010-08-231-2/+5
| | | | | | | | | | | That revision started classifying truly empty structs like "Y" and "X" as being NoClass/NoClass and turning them into 'ignore'. The call code turns around and allocates space for the ignored argument with GetUndefRValue. The bug is that GetUndefRValue would return the address as undef, instead of returning an object with a defined address but undefined contents. llvm-svn: 111794
* Abstract out everything having to do with member pointers into the ABIJohn McCall2010-08-238-219/+285
| | | | | | | | | | | class; they should just be completely opaque throughout IR gen now, although I haven't really audited that. Fix a bug apparently inherited from gcc-4.2 where we failed to null-check member data pointers when performing derived-to-base or base-to-derived conversions on them. llvm-svn: 111789
* Extract a method to check whether a function is the global placementJohn McCall2010-08-231-10/+21
| | | | | | operator new[]. llvm-svn: 111788
* Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall2010-08-2212-114/+92
| | | | | | | | | 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
* Eliminate a stale assertion. Fixes Clang self-host.Douglas Gregor2010-08-221-4/+1
| | | | llvm-svn: 111782
* When performing value-initialization for a class with a non-trivial,Douglas Gregor2010-08-222-23/+15
| | | | | | | | | | | | implicitly-defined default constructor, zero-initialize the memory before calling the default constructor. Previously, we would only zero-initialize in the case of a trivial default constructor. Also, simplify the hideous logic that determines when we have a trivial default constructor and, therefore, don't need to emit any call at all. llvm-svn: 111779
* Clean up a very silly use of first-class aggregates.John McCall2010-08-221-8/+2
| | | | llvm-svn: 111777
* Experiment with using first-class aggregates to represent member functionJohn McCall2010-08-2211-290/+206
| | | | | | | | | | 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
* Extract member function pointer comparison and null comparison intoJohn McCall2010-08-225-35/+150
| | | | | | | | | | | | the ABI code. Implement correct semantics for these on ARM. I believe this completes the implementation of member function pointers on ARM. I think I'm going to switch member function pointers over to be non-aggregates while I have all this in mind. llvm-svn: 111774
* Abstract out member-pointer creation. I'm really unhappy about the currentJohn McCall2010-08-226-74/+129
| | | | | | | | duplication between the constant and non-constant paths in all of this. Implement ARM ABI semantics for member pointer constants and conversion. llvm-svn: 111772
* Abstract more member-pointerness out.John McCall2010-08-227-71/+174
| | | | llvm-svn: 111771
* Abstract out member-pointer conversions.John McCall2010-08-224-39/+92
| | | | | | Pretty much everything having to do with member pointers is ABI-specific. llvm-svn: 111770
* Detabify.Eli Friedman2010-08-225-10/+10
| | | | llvm-svn: 111768
* Implement the call parts of the member-function-pointer ARM C++ ABI.John McCall2010-08-221-23/+56
| | | | llvm-svn: 111766
* Extract calls to method pointers out as an ABI routine.John McCall2010-08-224-66/+126
| | | | | | No functionality change. llvm-svn: 111752
* The ARM C++ ABI is sufficiently different from the Itanium C++ ABI thatJohn McCall2010-08-213-1/+19
| | | | | | | it deserves its own enumerator. Obviously the implementations should closely follow the Itanium ABI except in cases of divergence. llvm-svn: 111749
* IRgen: Set the alignment correctly when creating LValue for a decls.Daniel Dunbar2010-08-212-11/+17
| | | | | | | - Fixes PR5598. - Review appreciated. llvm-svn: 111726
* CodeGenFunction: Eliminate unused MakeQualifiers() function.Daniel Dunbar2010-08-211-6/+0
| | | | llvm-svn: 111725
* Simplify.Daniel Dunbar2010-08-211-3/+2
| | | | llvm-svn: 111724
* IRgen/CGValue: Give MakeAddrLValue() an alignment argument, and eliminate ↵Daniel Dunbar2010-08-212-10/+6
| | | | | | old form of MakeAddr(). llvm-svn: 111723
* IRgen: Move remaining LValue::Set... methods to LValue::set... (non-static) ↵Daniel Dunbar2010-08-212-24/+22
| | | | | | methods. llvm-svn: 111722
* IRgen: Move remaining MakeAddr() calls to MakeAddrLValue().Daniel Dunbar2010-08-212-26/+23
| | | | llvm-svn: 111721
* IRgen: The CVR qualifiers in a subobject adjustment should just come from theDaniel Dunbar2010-08-211-16/+10
| | | | | | | field (I think). - Doug, please check. llvm-svn: 111720
OpenPOWER on IntegriCloud