summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-03-28 06:46:51 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-03-28 06:46:51 +0000
commit0c78ac11dd1a2cb4012df6ae5b875d70d34e780b (patch)
tree945a275dd2678892b91aa95e27e47f539f82eeb2
parent7f0965e7daa17f0c5987fb923cab94ed7f6f4d78 (diff)
downloadllvm-0c78ac11dd1a2cb4012df6ae5b875d70d34e780b.tar.gz
llvm-0c78ac11dd1a2cb4012df6ae5b875d70d34e780b.tar.bz2
llvm-0c78ac11dd1a2cb4012df6ae5b875d70d34e780b.tar.xz
Update example to new syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48910 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--docs/Passes.html2
-rw-r--r--lib/VMCore/Verifier.cpp10
2 files changed, 9 insertions, 3 deletions
diff --git a/docs/Passes.html b/docs/Passes.html
index 3492a27970..a01b754d70 100644
--- a/docs/Passes.html
+++ b/docs/Passes.html
@@ -1864,7 +1864,7 @@ if (i == j)
<li>The code is in valid SSA form.</li>
<li>It should be illegal to put a label into any other type (like a
structure) or to return one. [except constant arrays!]</li>
- <li>Only phi nodes can be self referential: <tt>%x = add int %x, %x</tt> is
+ <li>Only phi nodes can be self referential: <tt>%x = add i32 %x, %x</tt> is
invalid.</li>
<li>PHI nodes must have an entry for each predecessor, with no extras.</li>
<li>PHI nodes must be the first thing in a basic block, all grouped
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 4ac8c0f3a4..7ec0cf3a45 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -21,7 +21,7 @@
// * The code is in valid SSA form
// * It should be illegal to put a label into any other type (like a structure)
// or to return one. [except constant arrays!]
-// * Only phi nodes can be self referential: 'add int %0, %0 ; <int>:0' is bad
+// * Only phi nodes can be self referential: 'add i32 %0, %0 ; <int>:0' is bad
// * PHI nodes must have an entry for each predecessor, with no extras.
// * PHI nodes must be the first thing in a basic block, all grouped together
// * PHI nodes must have at least one entry
@@ -530,6 +530,12 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
// Ensure that basic blocks have terminators!
Assert1(BB.getTerminator(), "Basic Block does not have terminator!", &BB);
+ // Ensure that the BB doesn't point out of its Function for unwinding.
+ Assert2(!BB.getUnwindDest() ||
+ BB.getUnwindDest()->getParent() == BB.getParent(),
+ "Basic Block unwinds to block in different function!",
+ &BB, BB.getUnwindDest());
+
// Check constraints that this basic block imposes on all of the PHI nodes in
// it.
if (isa<PHINode>(BB.front())) {
@@ -1217,7 +1223,7 @@ void Verifier::visitInstruction(Instruction &I) {
}
// Definition must dominate use unless use is unreachable!
- Assert2(DT->dominates(OpBlock, BB) ||
+ Assert2(DT->dominates(Op, &I) ||
!DT->dominates(&BB->getParent()->getEntryBlock(), BB),
"Instruction does not dominate all uses!", Op, &I);
} else {