AsmWriter/Bitcode: MDLocalVariable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229022 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-02-13 01:39:44 +00:00
parent f594c2a210
commit a342d827bd
8 changed files with 124 additions and 10 deletions

View File

@ -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));