summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Tidy.Eric Christopher2012-04-101-2/+2
| | | | llvm-svn: 154383
* Revert r153613 as it's causing large compile-time regressions on the nightly ↵Chad Rosier2012-03-291-4/+2
| | | | | | testers. llvm-svn: 153660
* When we can't prove that the target of an aggregate copy isJohn McCall2012-03-281-2/+4
| | | | | | | a complete object, the memcpy needs to use the data size of the structure instead of its sizeof() value. Fixes PR12204. llvm-svn: 153613
* When an MMX output variable is tied to the input variable, we have to implicitlyBill Wendling2012-03-221-1/+6
| | | | | | | cast the value to x86_mmx. This gives the ASM string the correct call signature. <rdar://problem/10919182> llvm-svn: 153290
* When a variable has a specified asm name, but isn't using the register ↵Eli Friedman2012-03-151-0/+2
| | | | | | storage class, the asm name doesn't specify a register. PR12244. llvm-svn: 152873
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Fold debug scope emission into the cleanup scope.Eric Christopher2012-02-231-9/+2
| | | | llvm-svn: 151216
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-1/+1
| | | | | | CodeGenModule. llvm-svn: 149943
* Compatability fix for SwitchInst refactoring.Stepan Dyatkovskiy2012-02-011-1/+1
| | | | | | | | | | | | | | | | | The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. llvm-svn: 149482
* output body of folded case again.Fariborz Jahanian2012-01-171-1/+3
| | | | llvm-svn: 148361
* Folding away unreachable case statement.Fariborz Jahanian2012-01-171-7/+15
| | | | | | patch (slightly revised) by Aaron Ballman. llvm-svn: 148359
* Fixes a crash during constant folding of a switch and case Fariborz Jahanian2012-01-161-0/+10
| | | | | | | statement which has an unscoped case inside it. Patch by Aaron Ballman llvm-svn: 148243
* Switch the Alignment argument on AggValueSlot over to CharUnits, per John's ↵Eli Friedman2011-12-031-2/+1
| | | | | | review comment. llvm-svn: 145741
* Track alignment in AggValueSlot. No functional change in this patch, but ↵Eli Friedman2011-12-031-1/+3
| | | | | | I'll be introducing uses of the specified alignment soon. llvm-svn: 145736
* Implement support for dependent Microsoft __if_exists/__if_not_existsDouglas Gregor2011-10-251-0/+1
| | | | | | | | | | statements. As noted in the documentation for the AST node, the semantics of __if_exists/__if_not_exists are somewhat different from the way Visual C++ implements them, because our parsed-template representation can't accommodate VC++ semantics without serious contortions. Hopefully this implementation is "good enough". llvm-svn: 142901
* Recommit:Eric Christopher2011-10-131-27/+16
| | | | | | | | | | | | | | | Start handling debug line and scope information better: Migrate most of the location setting within the larger API in CGDebugInfo and update a lot of callers. Remove the existing file/scope change machinery in UpdateLineDirectiveRegion and replace it with DILexicalBlockFile usage. Finishes off the rest of rdar://10246360 after fixing a few bugs that were exposed in gdb testsuite testing. llvm-svn: 141893
* Revert file/scope handling patches. gdb testing revealed a couple of bugs.Eric Christopher2011-10-121-16/+27
| | | | llvm-svn: 141796
* Start handling debug line and scope information better:Eric Christopher2011-10-111-27/+16
| | | | | | | | | | | Migrate most of the location setting within the larger API in CGDebugInfo and update a lot of callers. Remove the existing file/scope change machinery in UpdateLineDirectiveRegion and replace it with DILexicalBlockFile usage. Finishes off the rest of rdar://10246360 llvm-svn: 141732
* Constant expression evaluation refactoring:Richard Smith2011-10-101-5/+5
| | | | | | | | | | | - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions, and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert behaviour. - Factor out evaluation of bitfield bit widths. - Fix a few places which would evaluate an expression twice: once to determine whether it is a constant expression, then again to get the value. llvm-svn: 141561
* Change "Regions" to be "LexicalBlocks" since that's what theyEric Christopher2011-09-291-6/+6
| | | | | | correspond to. llvm-svn: 140740
* Rename EmitStopPoint in CGDebugInfo to EmitLocation. "stop points" don'tEric Christopher2011-09-291-1/+1
| | | | | | exist anymore. llvm-svn: 140739
* Call UpdateLineDirectiveRegion every time we want to emit a stopEric Christopher2011-09-291-1/+0
| | | | | | | point in the code. Ensures that we don't miss any places and the check is reasonably cheap. llvm-svn: 140737
* de-tmpify clang.Benjamin Kramer2011-09-271-1/+1
| | | | llvm-svn: 140637
* Fix comment to reflect reality.Eric Christopher2011-09-261-2/+1
| | | | llvm-svn: 140530
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-2/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-2/+4
| | | | llvm-svn: 140367
* Track whether an AggValueSlot is potentially aliased, and do notJohn McCall2011-08-251-1/+2
| | | | | | | | | | emit call results into potentially aliased slots. This allows us to properly mark indirect return slots as noalias, at the cost of requiring an extra memcpy when assigning an aggregate call result into a l-value. It also brings us into compliance with the x86-64 ABI. llvm-svn: 138599
* Use stronger typing for the flags on AggValueSlot and requireJohn McCall2011-08-251-1/+3
| | | | | | | creators to tell us whether something needs GC barriers. No functionality change. llvm-svn: 138581
* Simplify EH control flow by observing that EH scopes form a simpleJohn McCall2011-08-111-0/+17
| | | | | | | | | | | | | | | hierarchy of delegation, and that EH selector values are meaningful function-wide (good thing, too, or inlining wouldn't work). 2,3d 1a hierarchy of delegation and that EH selector values have the same meaning everywhere in the function instead of being meaningful only in the context of a specific selector. This removes the need for routing edges through EH cleanups, since a cleanup simply always branches to its enclosing scope. llvm-svn: 137293
* Fix assertion failure in CodeGen where the input operand to an asmPeter Collingbourne2011-07-291-1/+5
| | | | | | | instruction is tied to an output operand which is a pointer, and the input operand is narrower than the output operand. llvm-svn: 136438
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-11/+11
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-6/+6
| | | | llvm-svn: 135370
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-1/+1
| | | | llvm-svn: 135265
* De-constify Types in StructType::get() and TargetData::getIntPtrType().Jay Foad2011-07-111-3/+3
| | | | llvm-svn: 134893
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-2/+2
| | | | llvm-svn: 134831
* Split out logic for valid clobbers and valid inline asm registers.Eric Christopher2011-06-281-0/+1
| | | | | | Fixes rdar://9281377 llvm-svn: 134016
* LValue carries a type now, so simplify the main EmitLoad/Store APIsJohn McCall2011-06-251-3/+2
| | | | | | by removing the redundant type parameter. llvm-svn: 133860
* Canonicalize register names properly.Eric Christopher2011-06-211-0/+2
| | | | | | Fixes rdar://9425559 llvm-svn: 133486
* Check the specific target to figure out if a constraint is a validEric Christopher2011-06-171-2/+5
| | | | | | | | | register constraint. Note that we're not checking if the register itself is valid for the constraint. Fixes rdar://9382985 llvm-svn: 133226
* Automatic Reference Counting.John McCall2011-06-151-1/+4
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Clang support for ARM Uv/Uy/Uq inline-asm constraints.Stuart Hastings2011-06-071-1/+1
| | | | | | rdar://problem/9037836 llvm-svn: 132737
* Rework r132576.Devang Patel2011-06-041-0/+5
| | | | | | Emit debug info only if there is an insertion point. The debug info should not force an insertion point. Codegen may later on decide to not emit code for some reason, see extensive comment in CodeGenFunction::EmitStmt(), and debug info should not get in the way. llvm-svn: 132610
* Emit debug info only if there is an insertion point. The debug info should ↵Devang Patel2011-06-031-7/+0
| | | | | | not force an insertion point. Codegen may later on decide to not emit code for some reason, see extensive comment in CodeGenFunction::EmitStmt(), and debug info should not get in the way. llvm-svn: 132576
* 80-column cleanup.Eric Christopher2011-06-031-2/+2
| | | | llvm-svn: 132548
* Fix the clang part of PR7952: rewrite the specialization of isa<> in DeclBase,Eli Friedman2011-05-211-1/+1
| | | | | | and stop abusing the multi-level dereference isa<> used to allow. llvm-svn: 131804
* Parsing/AST support for Structured Exception HandlingJohn Wiegley2011-04-281-0/+4
| | | | | | | | Patch authored by Sohail Somani. Provide parsing and AST support for Windows structured exception handling. llvm-svn: 130366
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-211-1/+1
| | | | llvm-svn: 129929
* use the newly introduced IRBuilder getInt() method to reduce someChris Lattner2011-04-191-17/+12
| | | | | | redundancy pointed out by John. llvm-svn: 129808
* Fix a miscompilation I introduced in r129652, thanks for Eli for tracking Chris Lattner2011-04-171-1/+9
| | | | | | | | | | | | | | | it down. we effectively were compile the testcase into: void test14(int x) { switch (x) { case 11: break; case 42: test14(97); // fallthrough default: test14(42); break; which is not the same thing at all. This fixes a miscompilation of MallocBench/gs seen on the clang-x86_64-linux-fnt buildbot. llvm-svn: 129679
* implement rdar://9289524 - case followed immediately by break results in ↵Chris Lattner2011-04-171-0/+14
| | | | | | | | empty IR block, a -O0 code quality issue. llvm-svn: 129652
OpenPOWER on IntegriCloud