diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-28 01:07:33 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-28 01:07:33 +0000 |
commit | 1ec75ae963e8d3c8525997bf039db1a5d70bcb64 (patch) | |
tree | 43b240b13fbc66267e269f28534a9efe9084351a /llvm/lib/IR/DebugInfoMetadata.cpp | |
parent | b3053d9cbe930de13d2cd391f649d4ab714f6986 (diff) | |
download | bcm5719-llvm-1ec75ae963e8d3c8525997bf039db1a5d70bcb64.tar.gz bcm5719-llvm-1ec75ae963e8d3c8525997bf039db1a5d70bcb64.zip |
DebugInfo: Support up to 2^16 arguments in a subprogram
Support up to 2^16 arguments to a function. If we do hit the limit,
assert out rather than restarting at 0 as we've done historically.
This fixes PR23332. A clang test will follow.
llvm-svn: 235955
Diffstat (limited to 'llvm/lib/IR/DebugInfoMetadata.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfoMetadata.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index f6f2ff2d20c..4be35636cf8 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -456,11 +456,8 @@ MDLocalVariable *MDLocalVariable::getImpl(LLVMContext &Context, unsigned Tag, Metadata *Type, unsigned Arg, unsigned Flags, 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; + // 64K ought to be enough for any frontend. + assert(Arg <= UINT16_MAX && "Expected argument number to fit in 16-bits"); assert(Scope && "Expected scope"); assert(isCanonical(Name) && "Expected canonical MDString"); |