summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-10-13 07:57:33 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-10-13 07:57:33 +0000
commit9bc890425a6172eeb86a92fe2aeed39c6c1b8422 (patch)
tree1806357df93ca722a36c92ea9a30d112937633f8
parente2782c7614630e2c5eae5677388784f9b2ae8396 (diff)
downloadbcm5719-llvm-9bc890425a6172eeb86a92fe2aeed39c6c1b8422.tar.gz
bcm5719-llvm-9bc890425a6172eeb86a92fe2aeed39c6c1b8422.zip
Force memory use markers to have a ConstantInt for the size argument.
llvm-svn: 83960
-rw-r--r--llvm/docs/LangRef.html20
-rw-r--r--llvm/lib/VMCore/Verifier.cpp11
2 files changed, 23 insertions, 8 deletions
diff --git a/llvm/docs/LangRef.html b/llvm/docs/LangRef.html
index 7adb89621f4..c5905791815 100644
--- a/llvm/docs/LangRef.html
+++ b/llvm/docs/LangRef.html
@@ -7018,8 +7018,9 @@ LLVM</a>.</p>
object's lifetime.</p>
<h5>Arguments:</h5>
-<p>The first argument is a the size of the object, or -1 if it is variable
- sized. The second argument is a pointer to the object.</p>
+<p>The first argument is a constant integer representing the size of the
+ object, or -1 if it is variable sized. The second argument is a pointer to
+ the object.</p>
<h5>Semantics:</h5>
<p>This intrinsic indicates that before this point in the code, the value of the
@@ -7047,8 +7048,9 @@ LLVM</a>.</p>
object's lifetime.</p>
<h5>Arguments:</h5>
-<p>The first argument is a the size of the object, or -1 if it is variable
- sized. The second argument is a pointer to the object.</p>
+<p>The first argument is a constant integer representing the size of the
+ object, or -1 if it is variable sized. The second argument is a pointer to
+ the object.</p>
<h5>Semantics:</h5>
<p>This intrinsic indicates that after this point in the code, the value of the
@@ -7075,8 +7077,9 @@ LLVM</a>.</p>
a memory object will not change.</p>
<h5>Arguments:</h5>
-<p>The first argument is a the size of the object, or -1 if it is variable
- sized. The second argument is a pointer to the object.</p>
+<p>The first argument is a constant integer representing the size of the
+ object, or -1 if it is variable sized. The second argument is a pointer to
+ the object.</p>
<h5>Semantics:</h5>
<p>This intrinsic indicates that until an <tt>llvm.invariant.end</tt> that uses
@@ -7103,8 +7106,9 @@ LLVM</a>.</p>
<h5>Arguments:</h5>
<p>The first argument is the matching <tt>llvm.invariant.start</tt> intrinsic.
- The second argument is a the size of the object, or -1 if it is variable
- sized and the third argument is a pointer to the object.</p>
+ The second argument is a constant integer representing the size of the
+ object, or -1 if it is variable sized and the third argument is a pointer
+ to the object.</p>
<h5>Semantics:</h5>
<p>This intrinsic indicates that the memory is mutable again.</p>
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp
index 257b2495a8a..75ea4c3e2f2 100644
--- a/llvm/lib/VMCore/Verifier.cpp
+++ b/llvm/lib/VMCore/Verifier.cpp
@@ -1578,6 +1578,17 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
"llvm.stackprotector parameter #2 must resolve to an alloca.",
&CI);
break;
+ case Intrinsic::lifetime_start:
+ case Intrinsic::lifetime_end:
+ case Intrinsic::invariant_start:
+ Assert1(isa<ConstantInt>(CI.getOperand(1)),
+ "size argument of memory use markers must be a constant integer",
+ &CI);
+ break;
+ case Intrinsic::invariant_end:
+ Assert1(isa<ConstantInt>(CI.getOperand(2)),
+ "llvm.invariant.end parameter #2 must be a constant integer", &CI);
+ break;
}
}
OpenPOWER on IntegriCloud