aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfoMetadata.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-27 17:56:39 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-27 17:56:39 +0000
commite2c61d9eece93cd6bc28b0af465d77097775cca4 (patch)
tree7bfa151a2dffbc3dd39293cb68c91471a2a12d50 /llvm/lib/IR/DebugInfoMetadata.cpp
parent463a0afe15b15d35d0c7dc9750ee3a5a480bcf8c (diff)
downloadllvm-e2c61d9eece93cd6bc28b0af465d77097775cca4.zip
llvm-e2c61d9eece93cd6bc28b0af465d77097775cca4.tar.gz
llvm-e2c61d9eece93cd6bc28b0af465d77097775cca4.tar.bz2
LLParser: Require non-null scope for MDLocation and MDLocalVariable
Change `LLParser` to require a non-null `scope:` field for both `MDLocation` and `MDLocalVariable`. There's no need to wait for the verifier for this check. This also allows their `::getImpl()` methods to assert that the incoming scope is non-null. llvm-svn: 233394
Diffstat (limited to 'llvm/lib/IR/DebugInfoMetadata.cpp')
-rw-r--r--llvm/lib/IR/DebugInfoMetadata.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index 89ec1bc..63a0b59 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -44,6 +44,7 @@ MDLocation *MDLocation::getImpl(LLVMContext &Context, unsigned Line,
// Fixup column.
adjustColumn(Column);
+ assert(Scope && "Expected scope");
if (Storage == Uniqued) {
if (auto *N =
getUniqued(Context.pImpl->MDLocations,
@@ -345,6 +346,7 @@ MDLocalVariable *MDLocalVariable::getImpl(
// it matches historical behaviour for now.
Arg &= (1u << 8) - 1;
+ assert(Scope && "Expected scope");
assert(isCanonical(Name) && "Expected canonical MDString");
DEFINE_GETIMPL_LOOKUP(MDLocalVariable, (Tag, Scope, getString(Name), File,
Line, Type, Arg, Flags, InlinedAt));