summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Ugh, use this compiler workaround again.John McCall2011-07-121-3/+5
| | | | llvm-svn: 134989
* Switch field destruction over to use the new destroyer-based APIJohn McCall2011-07-126-399/+185
| | | | | | and kill a lot of redundant code. llvm-svn: 134988
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-121-6/+4
| | | | | | StructType::get() and TargetData::getIntPtrType(). llvm-svn: 134982
* 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-122-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* insert a bitcast in the 'expand' case of argument passing when needed. ThisChris Lattner2011-07-122-29/+40
| | | | | | fixes the -m32 build of oggenc. llvm-svn: 134971
* fix an unintended behavior change in the type system rewrite, which caused ↵Chris Lattner2011-07-121-4/+4
| | | | | | | | | | | | | | | | | | | | | us to compile stuff like this: typedef struct { int x, y, z; } foo_t; foo_t g; into: %"struct.<anonymous>" = type { i32, i32, i32 } we now get: %struct.foo_t = type { i32, i32, i32 } This doesn't change the behavior of the compiler, but makes the IR much easier to read. llvm-svn: 134969
* fix PR10335 by watching out for IR type compatibility in call argument lists.Chris Lattner2011-07-121-1/+5
| | | | llvm-svn: 134966
* add some aggressive assertions that call arguments match up to calleeChris Lattner2011-07-121-3/+40
| | | | | | expectations in EmitCall. Next patch will take this further. llvm-svn: 134962
* Fix a typo!Bruno Cardoso Lopes2011-07-121-1/+1
| | | | llvm-svn: 134952
* Do the same as r134946 for arrays. Add more testcases for avx x86_64 argBruno Cardoso Lopes2011-07-121-0/+7
| | | | | | passing. llvm-svn: 134951
* Revert r134888 (and related patches in other trees). It was causingBill Wendling2011-07-121-4/+6
| | | | | | | | | | | | | | an assert on Darwin llvm-gcc builds. Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, line 2067. etc. http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354 --- Reverse-merging r134888 into '.': U lib/CodeGen/CodeGenModule.cpp llvm-svn: 134950
* Fix one x86_64 abi issue and the test to actually look for the right thing,Bruno Cardoso Lopes2011-07-121-1/+8
| | | | | | which is: { <4 x float>, <4 x float> } should continue to go through memory. llvm-svn: 134946
* Do full-expression cleanups in a much more sensible way that still letsJohn McCall2011-07-125-96/+26
| | | | | | people write useful cleanup classes. llvm-svn: 134942
* Reapply r134754, which turns out to be working correctly and alsoBruno Cardoso Lopes2011-07-111-41/+73
| | | | | | add one more testcase. llvm-svn: 134934
* Emit partial destruction of structs with initializer lists.John McCall2011-07-111-20/+47
| | | | llvm-svn: 134913
* De-constify Types in StructType::get() and TargetData::getIntPtrType().Jay Foad2011-07-117-33/+32
| | | | llvm-svn: 134893
* Fix a lot of problems with the partial destruction of arrays:John McCall2011-07-113-86/+196
| | | | | | | | | | | - an off-by-one error in emission of irregular array limits for InitListExprs - use an EH partial-destruction cleanup within the normal array-destruction cleanup - get the branch destinations right for the empty check Also some refactoring which unfortunately obscures these changes. llvm-svn: 134890
* De-constify Types in FunctionType::get().Jay Foad2011-07-111-6/+4
| | | | llvm-svn: 134888
* Use cached types; no functionality change.John McCall2011-07-101-35/+18
| | | | llvm-svn: 134880
* implement a nice new optimization: CodeGenTypes::UpdateCompletedTypeChris Lattner2011-07-101-1/+1
| | | | | | | | | | | | | is called whenever a tag type is completed. We previously used that as the sign to layout the codegen representation for the tag type, which worked but meant that we laid out *every* completed type, whether it was used or not. Now we just lay out the type if we've already seen it somehow else. This means that we lay out types we've used but haven't seen a body for, but we don't lay out tons of stuff that noone cares about. llvm-svn: 134866
* enhance EmitLValueForFieldInitialization to do the proper pointer ↵Chris Lattner2011-07-101-9/+9
| | | | | | | | adjustment, allowing us to revert the other half of r134860. Now things are back to a relatively tidy state. llvm-svn: 134865
* revert part of r134860, which is empirically unnecessary after the proper fixChris Lattner2011-07-101-4/+0
| | | | llvm-svn: 134864
* keep track of whether being in a RS_StructPointer stateChris Lattner2011-07-102-2/+13
| | | | | | | | | | caused us to skip layout out a function accurately. If so, flush the type cache for both the function and struct case to ensure that any pointers to the functions get recomputed. This is overconservative, but with this patch clang can build itself again. llvm-svn: 134863
* change EmitLValueForField to cast the returned lvalue to the rightChris Lattner2011-07-101-13/+18
| | | | | | | type, even when in the struct case. This was one root issue that was causing type mismatches throughout the compiler. llvm-svn: 134862
* Fix the clang bootstrap and Jay's testcase from llvm-dev by being completelyChris Lattner2011-07-101-3/+30
| | | | | | | | | | conservative when converting a functiontype to IR when in a "pointer within a struct" context. This has the unfortunate sideeffect of compiling all function pointers inside of structs into "{}*" which, though correct, is ugly. This has the positive side effect of being correct, and it is pretty straight-forward to improve on this. llvm-svn: 134861
* when emitting pointer load from an lvalue or storing to an lvalue,Chris Lattner2011-07-101-0/+12
| | | | | | | do an explicit bitcast to whatever ConvertType produces. This will go with the next patch. llvm-svn: 134860
* how about we initialize RecursionState.Chris Lattner2011-07-102-2/+2
| | | | llvm-svn: 134855
* Rename CGT::VerifyFuncTypeComplete to isFuncTypeConvertible sinceChris Lattner2011-07-105-28/+65
| | | | | | | | | | | | | | | | | | it is a predicate, not an action. Change the return type to be a bool, not the incomplete member. Enhace it to detect the recursive compilation case, allowing us to compile Eli's testcase on llvmdev: struct T { struct T (*p)(void); } t; into: %struct.T = type { {}* } @t = common global %struct.T zeroinitializer, align 8 llvm-svn: 134853
* when an enum type is completed, only flush the type cache whenChris Lattner2011-07-091-2/+4
| | | | | | | the enum has already been converted. If not, there cannot be any types built on top of it, so there is no need to flush the cache. llvm-svn: 134841
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-0925-846/+734
| | | | llvm-svn: 134831
* More compiler workarounds. I have to admit that I was notJohn McCall2011-07-091-4/+14
| | | | | | | | expecting so much concentrated oddity on what seemed like a trivial feature. Thanks to François Pichet for doing the MSVC legwork here. llvm-svn: 134813
* GCC 4.2 compatibility hack.John McCall2011-07-091-3/+4
| | | | llvm-svn: 134785
* A number of array-related IR-gen cleanups.John McCall2011-07-096-218/+527
| | | | | | | | | | | | - Emit default-initialization of arrays that were partially initialized with initializer lists with a loop, rather than emitting the default initializer N times; - support destroying VLAs of non-trivial type, although this is not yet exposed to users; and - support the partial destruction of arrays initialized with initializer lists when an initializer throws an exception. llvm-svn: 134784
* Change -mno-mmx to be more compatible with gcc. Specifically, -mno-mmx ↵Eli Friedman2011-07-081-8/+16
| | | | | | | | | | | | should not imply -mno-sse. Note that because we don't usually touch the MMX registers anyway, all -mno-mmx needs to do is tweak the x86-32 calling convention a little for vectors that look like MMX vectors, and prevent the definition of __MMX__. clang doesn't actually stop the user from using MMX inline asm operands or MMX builtins in -mno-mmx mode; as a QOI issue, it would be nice to diagnose, but I doubt it really matters much. <rdar://problem/9694837> llvm-svn: 134770
* Revert x86_64 ABI changes until I have time to check the items raised by Eli.Bruno Cardoso Lopes2011-07-081-74/+42
| | | | llvm-svn: 134765
* Introduce __builtin_expect() intrinsic support.Jakub Staszak2011-07-081-4/+10
| | | | llvm-svn: 134761
* Add support for AVX 256-bit in the x86_64 ABI (as in the 0.99.5 draft)Bruno Cardoso Lopes2011-07-081-42/+74
| | | | llvm-svn: 134754
* Add codegen support for the fma/fmal/fmaf builtins.Cameron Zwarich2011-07-081-0/+16
| | | | llvm-svn: 134743
* Layout the code for trapping arithmetic so that the overflow case comes afterBill Wendling2011-07-071-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the normal case. Before, for this: $ cat t.c int test(int x) { return x * 2; } We would get this: addl %edi, %edi jno LBB0_2 ## BB#1: ## %overflow ud2 LBB0_2: ## %nooverflow movl %edi, %eax popq %rbp ret Now we get this: addl %edi, %edi jo LBB0_2 ## BB#1: ## %nooverflow movl %edi, %eax popq %rbp ret LBB0_2: ## %overflow ud2 <rdar://problem/8283919> llvm-svn: 134642
* r134634 causes a failure on MultiSource/Benchmarks/Olden/bh with TEST=nightly,Cameron Zwarich2011-07-071-15/+2
| | | | | | so roll it out. llvm-svn: 134638
* A redeclaration of an inline method in C99 mode should trigger emission of thatNick Lewycky2011-07-071-2/+15
| | | | | | function. Fixes PR10233! llvm-svn: 134634
* If we're using the pure non-fragile ABI, then skip some of the contortions ↵David Chisnall2011-07-071-9/+30
| | | | | | required to support the transitional ABI. llvm-svn: 134612
* Set a flag to tell the runtime when we're compiling in ARC mode and use the ↵David Chisnall2011-07-071-10/+19
| | | | | | pure-nonfragile ABI for both ARC and GC mode. llvm-svn: 134611
* In ARC, reclaim all return values of retainable type, not just thoseJohn McCall2011-07-076-1/+18
| | | | | | | | | | | | where we have an immediate need of a retained value. As an exception, don't do this when the call is made as the immediate operand of a __bridge retain. This is more in the way of a workaround than an actual guarantee, so it's acceptable to be brittle here. rdar://problem/9504800 llvm-svn: 134605
* Sort #includes.Nick Lewycky2011-07-071-1/+1
| | | | llvm-svn: 134589
* revert patch for // rdar://9227352Fariborz Jahanian2011-07-061-19/+0
| | | | llvm-svn: 134536
* Call objc_terminate() instead of abort() when a cleanup throws anJohn McCall2011-07-061-2/+11
| | | | | | | exception in Objective-C; in Objective-C++ we still use std::terminate(). This is only available in very recent runtimes. llvm-svn: 134456
* Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall2011-07-061-8/+2
| | | | | | | | | | | | structure to hold inferred information, then propagate each invididual bit down to -cc1. Separate the bits of "supports weak" and "has a native ARC runtime"; make the latter a CodeGenOption. The tool chain is still driving this decision, because it's the place that has the required deployment target information on Darwin, but at least it's better-factored now. llvm-svn: 134453
* Add the ObjC ARC optimization passes manually, now that they're notDan Gohman2011-07-052-6/+42
| | | | | | hardwired into the default pass list. llvm-svn: 134445
OpenPOWER on IntegriCloud