diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-13 01:39:44 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-13 01:39:44 +0000 |
commit | 72fe2d0b7928257881bdaba31984ccfc127eed08 (patch) | |
tree | e7ef367631fb25e7bd964d8ed8cd7e4c6c199e88 /llvm/lib/IR/DebugInfoMetadata.cpp | |
parent | 00dbc753dbf3dd716fc4a980e0cd63718dad5b7e (diff) | |
download | llvm-72fe2d0b7928257881bdaba31984ccfc127eed08.zip llvm-72fe2d0b7928257881bdaba31984ccfc127eed08.tar.gz llvm-72fe2d0b7928257881bdaba31984ccfc127eed08.tar.bz2 |
AsmWriter/Bitcode: MDLocalVariable
llvm-svn: 229022
Diffstat (limited to 'llvm/lib/IR/DebugInfoMetadata.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfoMetadata.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index 46ac98a..3d6ebbc 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -336,6 +336,12 @@ MDLocalVariable *MDLocalVariable::getImpl( LLVMContext &Context, unsigned Tag, Metadata *Scope, MDString *Name, Metadata *File, unsigned Line, Metadata *Type, unsigned Arg, unsigned Flags, Metadata *InlinedAt, StorageType Storage, bool ShouldCreate) { + // Truncate Arg to 8 bits. + // + // FIXME: This is gross (and should be changed to an assert or removed), but + // it matches historical behaviour for now. + Arg &= (1u << 8) - 1; + assert(isCanonical(Name) && "Expected canonical MDString"); DEFINE_GETIMPL_LOOKUP(MDLocalVariable, (Tag, Scope, getString(Name), File, Line, Type, Arg, Flags, InlinedAt)); |