ea66f9f9e17d619d617885e26adc1530cec7c0fd |
|
02-Aug-2012 |
Eli Friedman <eli.friedman@gmail.com> |
Make sure we don't emit IR for unused EH cleanups. PR13359. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
7c02cfeb0861278c09ba05d1b92bd2a996bbe2e0 |
|
11-Mar-2012 |
Stepan Dyatkovskiy <stpworld@narod.ru> |
llvm::SwitchInst Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default. Added some notes relative to case iterators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
aae1d8bd6f2482e0bf13a29d5b0cb7639080974d |
|
08-Mar-2012 |
Stepan Dyatkovskiy <stpworld@narod.ru> |
Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*". ConstCaseIt is just a read-only iterator. CaseIt is read-write iterator; it allows to change case successor and case value. Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters. Main way of iterator usage looks like this: SwitchInst *SI = ... // intialize it somehow for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) { BasicBlock *BB = i.getCaseSuccessor(); ConstantInt *V = i.getCaseValue(); // Do something. } If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method. If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method. There are also related changes in llvm-clients: klee and clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
ab14ae2ab16088b6a7f69eac6e152c3e9f9ea01b |
|
01-Feb-2012 |
Stepan Dyatkovskiy <stpworld@narod.ru> |
Compatability fix for SwitchInst refactoring. 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
516bbd42e62d709013824d6fb8445a0cfda3129a |
|
26-Jan-2012 |
Peter Collingbourne <peter@pcc.me.uk> |
Use function pointers, rather than references, to pass Destroyers around, in the process cleaning up the various gcc/msvc compiler workarounds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
3026348bd4c13a0f83b59839f64065e0fcbea253 |
|
20-Jan-2012 |
David Blaikie <dblaikie@gmail.com> |
More dead code removal (using -Wunreachable-code) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
5c00fc309bec8900a798e7d5f87d1ccab7908a28 |
|
28-Nov-2011 |
Peter Collingbourne <peter@pcc.me.uk> |
Another silly workaround for MSVC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
567f02f3b81b5f16b990bae0640d77022d46c922 |
|
28-Nov-2011 |
Peter Collingbourne <peter@pcc.me.uk> |
Sigh, another workaround for MSVC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
3fb91f6abd15b117dbd2c930f626fa87fe7a3b10 |
|
28-Nov-2011 |
Peter Collingbourne <peter@pcc.me.uk> |
Work around a gcc4.2 bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
86811609d9353e3aed198045d56e790eb3b6118c |
|
27-Nov-2011 |
Peter Collingbourne <peter@pcc.me.uk> |
When destroying temporaries, instead of a custom cleanup use the generic pushDestroy function. This would reduce the number of useful declarations in CGTemporaries.cpp to one. Since CodeGenFunction::EmitCXXTemporary does not deserve its own file, move it to CGCleanup.cpp and delete CGTemporaries.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
6f103ba42cb69d50005a977c5ea583984ab63fc4 |
|
10-Nov-2011 |
John McCall <rjmccall@apple.com> |
Whenever explicitly activating or deactivating a cleanup, we need to provide a 'dominating IP' which is guaranteed to dominate the (de)activation point but which cannot be avoided along any execution path from the (de)activation point to the push-point of the cleanup. Using the entry block is bad mojo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
b99785bdd1cc9ce1ba4f94eeb871faba1a22e95f |
|
10-Nov-2011 |
John McCall <rjmccall@apple.com> |
Fix a subtle bug with cleanups: when activating a previously-inactive cleanup, not only do we need a flag variable, but we should also force the cleanup to query the flag variable. However, we only need to do this when we're activating in a context that's conditionally executed; otherwise, we may safely assume that the cleanup is dominated by the activation point. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
777d6e56ad9b1fed9866daf3ee6486d85c5b7d32 |
|
11-Aug-2011 |
John McCall <rjmccall@apple.com> |
Simplify EH control flow by observing that EH scopes form a simple 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137293 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
e7d002041dc60521f237b4219fd4167d1fe67aa7 |
|
10-Aug-2011 |
John McCall <rjmccall@apple.com> |
Formatting. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
f66a3ea8595d44843f43b8c4b0825b1f8ceeda78 |
|
07-Aug-2011 |
John McCall <rjmccall@apple.com> |
Avoid fallthrough-branching to an inactive cleanup even if it's otherwise required. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
82cd2e5c15aa909ec9613c4228ab69e07f1c6f7a |
|
06-Aug-2011 |
John McCall <rjmccall@apple.com> |
Be sure to destroy the normal entry block of a cleanup that we aren't actually going to make a normal cleanup for. Sometimes we optimistically create branches to such blocks for fixups, and then we resolve the fixup to somewhere within the cleanup's scope, and then the cleanup is actually not reachable for some reason. The process of resolving the fixup leaves us with switches whose default edge leads to the cleanup; we can replace that with unreachable, then (in many cases) turn the switch into an unconditional branch. Fixes PR10467. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
5f9e272e632e951b1efe824cd16acb4d96077930 |
|
23-Jul-2011 |
Chris Lattner <sabre@nondot.org> |
remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports them into the clang namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
2acc6e3feda5e4f7d9009bdcf8b1cd777fecfe2d |
|
18-Jul-2011 |
Chris Lattner <sabre@nondot.org> |
de-constify llvm::Type, patch by David Blaikie! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
ad346f4f678ab1c3222425641d851dc63e9dfa1a |
|
12-Jul-2011 |
John McCall <rjmccall@apple.com> |
Generalize Cleanup::Emit's "isForEH" parameter into a set of flags. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
c4a1a8450a3613ef256a71b9d8305b41f79eef50 |
|
12-Jul-2011 |
John McCall <rjmccall@apple.com> |
Do full-expression cleanups in a much more sensible way that still lets people write useful cleanup classes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
d36d036c819f7925b933974fa18eacc95d46049a |
|
20-Jun-2011 |
Jay Foad <jay.foad@gmail.com> |
Change how PHINodes store their operands. Change PHINodes to store simple pointers to their incoming basic blocks, instead of full-blown Uses. Note that this loses an optimization in SplitCriticalEdge(), because we can no longer walk the use list of a BasicBlock to find phi nodes. See the comment I removed starting "However, the foreach loop is slow for blocks with lots of predecessors". Extend replaceAllUsesWith() on a BasicBlock to also update any phi nodes in the block's successors. This mimics what would have happened when PHINodes were proper Users of their incoming blocks. (Note that this only works if OldBB->replaceAllUsesWith(NewBB) is called when OldBB still has a terminator instruction, so it still has some successors.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
7650d95a1a616ea300f37126a8dfc93dc19a662a |
|
19-Jun-2011 |
Chris Lattner <sabre@nondot.org> |
update for api change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
b11f9198111796ada02b57f62cdea92134fde9f7 |
|
17-Apr-2011 |
Chris Lattner <sabre@nondot.org> |
implement rdar://9289524 - case followed immediately by break results in empty IR block, a -O0 code quality issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
27f8d703e65095ca9c8c5d08a5a835b5510a730d |
|
25-Feb-2011 |
John McCall <rjmccall@apple.com> |
Tame an assert; the scope depth of a jump destination does not 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126472 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
d16c2cf1cafa413709aa487cbbd5dc392f1ba1ff |
|
08-Feb-2011 |
John McCall <rjmccall@apple.com> |
Reorganize CodeGen{Function,Module} to eliminate the unfortunate Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|
36f893c1efe367f929d92c8b125f964c22ba189e |
|
28-Jan-2011 |
John McCall <rjmccall@apple.com> |
Move all the cleanups framework code into a single file. Pure motion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/CodeGen/CGCleanup.cpp
|