diff options
author | Christopher Lamb <christopher.lamb@gmail.com> | 2007-12-17 01:00:21 +0000 |
---|---|---|
committer | Christopher Lamb <christopher.lamb@gmail.com> | 2007-12-17 01:00:21 +0000 |
commit | 55c6d4f22f50f049146e050d93052023fd7cfd3b (patch) | |
tree | 986f32a7e5fbf641b4c669b60081fe7fa90cf84f /llvm/lib | |
parent | ca6bcae0bea61207a38a822502f56b7fdb76bf9b (diff) | |
download | bcm5719-llvm-55c6d4f22f50f049146e050d93052023fd7cfd3b.tar.gz bcm5719-llvm-55c6d4f22f50f049146e050d93052023fd7cfd3b.zip |
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.
llvm-svn: 45080
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index c3633ff97a1..fb8db1785da 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/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. /// |