diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2009-11-23 04:52:00 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2009-11-23 04:52:00 +0000 |
| commit | 890a1d120f3017927bd6b3120803d896f48f25b9 (patch) | |
| tree | a0354e271999a3e6e527133eb9f1fcd51ea21a48 /llvm/lib | |
| parent | 15a1287c1f3ba993028f0f37c3ef0adc08287719 (diff) | |
| download | bcm5719-llvm-890a1d120f3017927bd6b3120803d896f48f25b9.tar.gz bcm5719-llvm-890a1d120f3017927bd6b3120803d896f48f25b9.zip | |
Start catching LLVMContext misuse in the verifier.
llvm-svn: 89646
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index 7ab7b151684..7aa86b776c7 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/lib/VMCore/Verifier.cpp @@ -1475,6 +1475,9 @@ void Verifier::visitInstruction(Instruction &I) { void Verifier::VerifyType(const Type *Ty) { if (!Types.insert(Ty)) return; + Assert1(&Mod->getContext() == &Ty->getContext(), + "Type context does not match Module context!", Ty); + switch (Ty->getTypeID()) { case Type::FunctionTyID: { const FunctionType *FTy = cast<FunctionType>(Ty); |

