summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* -fwrapv should turn off the inbounds markers from geps used for pointerChris Lattner2011-03-012-36/+60
| | | | | | | arithmetic. This is part of PR9256, it would be great if someone else wired up -fno-strict-overflow in the driver to -fwrapv. llvm-svn: 126718
* Use single code path to handle c++ structs and classes while generating ↵Devang Patel2011-02-281-8/+6
| | | | | | debug info. llvm-svn: 126691
* Revert r126678.Fariborz Jahanian2011-02-281-13/+13
| | | | llvm-svn: 126685
* objc IRGen for Next runtime message API.Fariborz Jahanian2011-02-281-13/+13
| | | | | | | | | | The prototype for objc_msgSend() is technically variadic - `id objc_msgSend(id, SEL, ...)`. But all method calls should use a prototype that matches the method, not the prototype for objc_msgSend itself(). // rdar://9048030 llvm-svn: 126678
* Make skipping of vardecls more precise: it's ok to skip a decl if the entireChris Lattner2011-02-281-3/+18
| | | | | | compound stmt containing the decl is skipped. llvm-svn: 126639
* make switch constant folding a bit stronger, handling a missed case.Chris Lattner2011-02-281-3/+8
| | | | llvm-svn: 126638
* Add a -fcxx-exceptions flag to the frontend, which can be used to enableAnders Carlsson2011-02-281-2/+2
| | | | | | | | | | C++ exceptions, even when exceptions have been turned off using -fno-exceptions. Make the -fobjc-exceptions flag do the same thing, but for Objective-C exceptions. C++ and Objective-C exceptions can also be disabled using -fno-cxx-excptions and -fno-objc-exceptions. llvm-svn: 126630
* remove a bogus assertion, add a comment.Chris Lattner2011-02-281-3/+1
| | | | llvm-svn: 126603
* make switch condition constant folding much more aggressive, handling Chris Lattner2011-02-281-1/+68
| | | | | | | compound statements and break statements. This implements enough to handle PR9322 and rdar://6970405. llvm-svn: 126602
* fix my containsBreak predicate.Chris Lattner2011-02-281-0/+3
| | | | llvm-svn: 126600
* Get rid of the areExceptionsEnabled() getter from LangOptions.Anders Carlsson2011-02-283-6/+6
| | | | llvm-svn: 126598
* First tiny step to implementing PR9322: build infrastructure for only ↵Chris Lattner2011-02-281-0/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | emitting the live case of a switch statement when switching on a constant. This is terribly limited, but enough to handle the trivial example included. Before we would emit: define void @test1(i32 %i) nounwind { entry: %i.addr = alloca i32, align 4 store i32 %i, i32* %i.addr, align 4 switch i32 1, label %sw.epilog [ i32 1, label %sw.bb ] sw.bb: ; preds = %entry %tmp = load i32* %i.addr, align 4 %inc = add nsw i32 %tmp, 1 store i32 %inc, i32* %i.addr, align 4 br label %sw.epilog sw.epilog: ; preds = %sw.bb, %entry switch i32 0, label %sw.epilog3 [ i32 1, label %sw.bb1 ] sw.bb1: ; preds = %sw.epilog %tmp2 = load i32* %i.addr, align 4 %add = add nsw i32 %tmp2, 2 store i32 %add, i32* %i.addr, align 4 br label %sw.epilog3 sw.epilog3: ; preds = %sw.bb1, %sw.epilog ret void } now we emit: define void @test1(i32 %i) nounwind { entry: %i.addr = alloca i32, align 4 store i32 %i, i32* %i.addr, align 4 %tmp = load i32* %i.addr, align 4 %inc = add nsw i32 %tmp, 1 store i32 %inc, i32* %i.addr, align 4 ret void } This improves -O0 compile time (less IR to generate and shove through the code generator) and the clever linux kernel people found a way to fail to build if we don't do this optimization. This step isn't enough to handle the kernel case though. llvm-svn: 126597
* Add some helper methods that will be used in my next patch.Chris Lattner2011-02-282-4/+52
| | | | llvm-svn: 126596
* Change the interface to ConstantFoldsToSimpleInteger to not encode Chris Lattner2011-02-275-29/+42
| | | | | | a bool + success into one tri-state integer, simplifying things. llvm-svn: 126592
* Don't assume that whoever is asking for a message send is goingJohn McCall2011-02-261-2/+11
| | | | | | to give us a non-null return slot. llvm-svn: 126544
* Zero-initialize the struct-return slot of an Objective-C messageJohn McCall2011-02-261-0/+2
| | | | | | send before making the call. Fixes rdar://problem/7854674 llvm-svn: 126543
* A much-delayed response to Ken Dyck's review: make this somewhat moreJohn McCall2011-02-261-10/+16
| | | | | | char-width agnostic. llvm-svn: 126542
* Pretty up the emission of field l-values and use volatile and TBAA whenJohn McCall2011-02-262-26/+56
| | | | | | | loading references as part of that. Use 'char' TBAA when accessing (immediate!) fields of a may_alias struct; fixes PR9307. llvm-svn: 126540
* Tame an assert; the scope depth of a jump destination does notJohn McCall2011-02-251-1/+1
| | | | | | | | necessarily enclose the innermost normal cleanup depth, because the top of the jump scope stack might be an EH cleanup or EH scope. Fixes PR9303. llvm-svn: 126472
* Use private linkage to avoid symbol conflicts in corner cases like the oneRafael Espindola2011-02-241-1/+1
| | | | | | in PR9301. llvm-svn: 126422
* Fix type mismatch between property function that CGObjCGNU was returning and ↵David Chisnall2011-02-231-4/+4
| | | | | | the one CGObjC was calling. Fixes bug r9294. llvm-svn: 126312
* Emit the structure layout of the block literal parameter to a blockJohn McCall2011-02-226-86/+257
| | | | | | | | | | invocation function into the debug info. Rather than faking up a class, which is tricky because of the custom layout we do, we just emit a struct directly from the layout information we've already got. Also, don't emit an unnecessarily parameter alloca for this "variable". llvm-svn: 126255
* A constructor call should force class's debug info even if ↵Devang Patel2011-02-221-0/+11
| | | | | | -flimit-debug-info is enabled. llvm-svn: 126246
* Use LLVM coding standard.Devang Patel2011-02-221-93/+93
| | | | llvm-svn: 126232
* Establish the iteration variable of an ObjC for-in loop beforeJohn McCall2011-02-223-13/+33
| | | | | | | emitting the collection expression. Fixes some really, really broken code. llvm-svn: 126193
* Reorganize the emission of local variables.John McCall2011-02-226-164/+279
| | | | llvm-svn: 126189
* lib/CodeGen/TargetInfo.cpp: On Win64, arg i128 should be emitted as INDIRECT.NAKAMURA Takumi2011-02-221-2/+9
| | | | | | mingw-w64's i128 tweak should be done with x86_64-mingw32. llvm-svn: 126186
* The instance size of a metaclass should be the size of a class. This is ↵David Chisnall2011-02-211-1/+6
| | | | | | not, in fact, 0, even for very small classes. (GNU runtime) llvm-svn: 126161
* Bind references to opaque r-values correctly. Add a few test casesJohn McCall2011-02-211-0/+4
| | | | | | for ?: on record types. llvm-svn: 126113
* Implement the C++0x deduced 'auto' feature.Richard Smith2011-02-203-2/+1
| | | | | | This fixes PR 8738, 9060 and 9132. llvm-svn: 126069
* Add a LangOptions::areExceptionsEnabled and start using it.Anders Carlsson2011-02-205-9/+8
| | | | llvm-svn: 126062
* Re-instate r125819 and r125820 with no functionality changePeter Collingbourne2011-02-194-16/+64
| | | | llvm-svn: 126060
* In addition to in-class member functions marked with the "used"Douglas Gregor2011-02-191-1/+2
| | | | | | | attribute, we also care about those with the "constructor" attribute. Fixes PR6521. llvm-svn: 126055
* Revert 125820 and 125819 to fix PR9266.Rafael Espindola2011-02-194-64/+16
| | | | llvm-svn: 126050
* Warn about code that uses variables and functions with internal linkageJohn McCall2011-02-191-1/+1
| | | | | | | | | | | | | | without defining them. This should be an error, but I'm paranoid about "uses" that end up not actually requiring a definition. I'll revisit later. Also, teach IR generation to not set internal linkage on variable declarations, just for safety's sake. Doing so produces an invalid module if the variable is not ultimately defined. Also, fix several places in the test suite where we were using internal functions without definitions. llvm-svn: 126016
* Start using enums from DIBuilder.Devang Patel2011-02-181-9/+9
| | | | llvm-svn: 125990
* If -fno-builtin is passed, tell TargetLibraryInfo toChris Lattner2011-02-181-2/+9
| | | | | | turn off all builtin optimizations. llvm-svn: 125979
* install a TargetLibraryInfo configured with the appropriate Chris Lattner2011-02-181-3/+12
| | | | | | | target triple. This would be a decent place to add -fno-builtin info for example. llvm-svn: 125971
* Objective-c armv7 API for atomic properties of Fariborz Jahanian2011-02-182-97/+139
| | | | | | scalar types. // rdar://7761305 llvm-svn: 125946
* The flags we're supposed to write into a byref struct are *not* theJohn McCall2011-02-181-12/+13
| | | | | | | | | | | | _Block_object_* flags; it's just BLOCK_HAS_COPY_DISPOSE or not. Also, we don't need to chase forwarding pointers prior to calling _Block_object_dispose; _Block_object_dispose in fact already does this. rdar://problem/9006315 llvm-svn: 125823
* Move CompilerInstance::LLVMContext and LLVMContext ownership to CodeGenActionPeter Collingbourne2011-02-181-12/+28
| | | | | | | | | This removes the final dependency edge from any lib outside of CodeGen to core. As a result we can, and do, trim the dependency on core from libclang, PrintFunctionNames, the unit tests and c-index-test. While at it, review and trim other unneeded dependencies. llvm-svn: 125820
* Move TargetInfo::adjustInlineAsmType to TargetCodeGenInfoPeter Collingbourne2011-02-183-4/+36
| | | | llvm-svn: 125819
* implement basic support for __label__. I wouldn't be shocked if there areChris Lattner2011-02-181-1/+1
| | | | | | | | | bugs from other clients that don't expect to see a LabelDecl in a DeclStmt, but if so they should be easy to fix. This implements most of PR3429 and rdar://8287027 llvm-svn: 125817
* improve support for big endian targets, fixing PR8171, patchChris Lattner2011-02-172-3/+16
| | | | | | by Heikki Kultala! llvm-svn: 125784
* Remove the "conditional save" hashtables from IR generation.John McCall2011-02-174-23/+1
| | | | llvm-svn: 125761
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-177-142/+237
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.NAKAMURA Takumi2011-02-171-1/+1
| | | | | | No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. llvm-svn: 125742
* Fix whitespace.NAKAMURA Takumi2011-02-171-1/+1
| | | | llvm-svn: 125741
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-174-16/+17
| | | | | | | | | | | | | | | | | | | LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
* Ensure that the NRVO flag has some block to insert into. Fixes PR9178!Nick Lewycky2011-02-161-1/+2
| | | | llvm-svn: 125694
OpenPOWER on IntegriCloud