mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-27 23:33:55 +00:00
Extend the verifier to check usage of 'nonnull' metadata.
The recently added !nonnull metadata is only valid on loads of pointer type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220323 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
de246de958
commit
5127ff928b
@ -2287,6 +2287,14 @@ void Verifier::visitInstruction(Instruction &I) {
|
||||
visitRangeMetadata(I, Range, I.getType());
|
||||
}
|
||||
|
||||
if (I.getMetadata(LLVMContext::MD_nonnull)) {
|
||||
Assert1(I.getType()->isPointerTy(),
|
||||
"nonnull applies only to pointer types", &I);
|
||||
Assert1(isa<LoadInst>(I),
|
||||
"nonnull applies only to load instructions, use attributes"
|
||||
" for calls or invokes", &I);
|
||||
}
|
||||
|
||||
InstsInThisBlock.insert(&I);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user