summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Don't use x86_mmx where it isn't necessary.Eli Friedman2011-07-021-6/+1
| | | | | | The start of some work on getting -mno-mmx working the way we want it to. llvm-svn: 134300
* Update for llvm commit r134291.Eric Christopher2011-07-021-2/+2
| | | | | | Fixes rdar://9714064 llvm-svn: 134292
* Emit guard variables for any weak global that has a run-timeDouglas Gregor2011-07-011-6/+5
| | | | | | | initializer. Previously, we only used guard variables for weak static data members. Fixes <rdar://problem/9692249>. llvm-svn: 134266
* Don't zero-initialize default-initialized local variables that haveDouglas Gregor2011-07-011-1/+18
| | | | | | | | trivial default constructors. This generated-code regression was caused by r131796, which had simplified the handling of default initialization in Sema. Fixes <rdar://problem/9694300>. llvm-svn: 134260
* Add support for weakly imported classes (GNU runtime).David Chisnall2011-06-301-5/+8
| | | | llvm-svn: 134140
* createTargetMachine now takes a CPU string.Evan Cheng2011-06-301-3/+3
| | | | llvm-svn: 134128
* objc-arc: fix a IRGen crash when checking forFariborz Jahanian2011-06-291-1/+2
| | | | | | | accessibility of an initializer which is a compound statement. // rdar://9694706 llvm-svn: 134091
* Use existing -fcatch-undefined-behavior option,Fariborz Jahanian2011-06-291-1/+1
| | | | | | replacing -freset-local-blocks. // rdar://9227352 llvm-svn: 134082
* Add ARC support for the GNUstep runtime.David Chisnall2011-06-291-6/+20
| | | | llvm-svn: 134065
* We don't pass classes with a copy-constructor or destructor byval, so the ↵Eli Friedman2011-06-291-0/+2
| | | | | | | | | | address takes up an integer register (if one is available). Make sure the x86-64 ABI implementation takes that into account properly. The fixed implementation is compatible with the implementation both gcc and llvm-gcc use. rdar://9686430 . (This is the issue that was reported in the thread "[LLVMdev] Segfault calling LLVM libs from a clang-compiled executable".) llvm-svn: 134059
* SubtargetFeature.h has been moved to MC.Evan Cheng2011-06-291-1/+1
| | | | llvm-svn: 134050
* Under a compiler flag, -freset-local-blocks,Fariborz Jahanian2011-06-281-0/+19
| | | | | | | wipe out stack blocks when they go out of scope. // rdar://9227352 llvm-svn: 134045
* Split out logic for valid clobbers and valid inline asm registers.Eric Christopher2011-06-281-0/+1
| | | | | | Fixes rdar://9281377 llvm-svn: 134016
* Eliminate most uses of ShallowCollectObjCIvars which requiresFariborz Jahanian2011-06-282-25/+24
| | | | | | | a vector for collection. Use iterators where needed instead. // rdar://6817577 llvm-svn: 134015
* Fix PR10204 in a better way.John McCall2011-06-271-3/+1
| | | | llvm-svn: 133943
* Revert parts of r133860 to fix a crash. Add a test.Nico Weber2011-06-271-1/+3
| | | | llvm-svn: 133931
* Cleanup cast IRGen a bit; no intended functionality change.Eli Friedman2011-06-252-34/+65
| | | | llvm-svn: 133864
* Do not apply the ARC move optimization to 'const'-qualified xvalues.John McCall2011-06-251-1/+1
| | | | llvm-svn: 133861
* LValue carries a type now, so simplify the main EmitLoad/Store APIsJohn McCall2011-06-259-104/+93
| | | | | | by removing the redundant type parameter. llvm-svn: 133860
OpenPOWER on IntegriCloud