summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristopher Lamb <christopher.lamb@gmail.com>2007-12-17 01:00:21 +0000
committerChristopher Lamb <christopher.lamb@gmail.com>2007-12-17 01:00:21 +0000
commit303dae993aba2474a23753ed66737b8c38cc97a0 (patch)
treebf2ee3531b1f46bfdaf73f6036602f8c930c3d49 /lib
parent17af3577791f44429bc43c20cd787b960ec5d3b4 (diff)
downloadllvm-303dae993aba2474a23753ed66737b8c38cc97a0.tar.gz
llvm-303dae993aba2474a23753ed66737b8c38cc97a0.tar.bz2
llvm-303dae993aba2474a23753ed66737b8c38cc97a0.tar.xz
Make it clear in the LangRef that allocation instructions only operated on the generic address space. Implement support in the verifier for ensuring this is true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45080 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Verifier.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index c3633ff97a..fb8db1785d 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -254,6 +254,7 @@ namespace { // Anonymous namespace for class
void visitUserOp1(Instruction &I);
void visitUserOp2(Instruction &I) { visitUserOp1(I); }
void visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI);
+ void visitAllocationInst(AllocationInst &AI);
void VerifyIntrinsicPrototype(Intrinsic::ID ID, Function *F,
unsigned Count, ...);
@@ -987,6 +988,13 @@ void Verifier::visitStoreInst(StoreInst &SI) {
visitInstruction(SI);
}
+void Verifier::visitAllocationInst(AllocationInst &AI) {
+ const PointerType *Ptr = AI.getType();
+ Assert(Ptr->getAddressSpace() == 0,
+ "Allocation instruction pointer not in the generic address space!");
+ visitInstruction(AI);
+}
+
/// verifyInstruction - Verify that an instruction is well formed.
///