diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-06 22:50:13 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-06 22:50:13 +0000 |
commit | af677ebb41036e950f0405becee6b530907bae41 (patch) | |
tree | 9bacc443b22b695c59035b1e3a46f912fd75fc6d /llvm/lib | |
parent | acf8288669b63ad476e7e15ecf0e4c68e4fcb889 (diff) | |
download | bcm5719-llvm-af677ebb41036e950f0405becee6b530907bae41.tar.gz bcm5719-llvm-af677ebb41036e950f0405becee6b530907bae41.zip |
IR: Allow 32-bits for lines in debug location
Remove unnecessary restriction of 24-bits for line numbers in
`MDLocation`.
The rest of the debug info schema (with the exception of local
variables) uses 32-bits for line numbers. As I introduce the
specialized nodes, it makes sense to canonicalize on one size or the
other.
llvm-svn: 228455
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/IR/DebugInfoMetadata.cpp | 10 |
2 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 65627097fdf..6bf3d803a21 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -2946,7 +2946,7 @@ struct MDUnsignedField : public MDFieldImpl<uint64_t> { : ImplTy(Default), Max(Max) {} }; struct LineField : public MDUnsignedField { - LineField() : MDUnsignedField(0, UINT32_MAX >> 8) {} + LineField() : MDUnsignedField(0, UINT32_MAX) {} }; struct ColumnField : public MDUnsignedField { ColumnField() : MDUnsignedField(0, UINT16_MAX) {} diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index 467d21ad36a..c540cc45a61 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -24,19 +24,12 @@ MDLocation::MDLocation(LLVMContext &C, StorageType Storage, unsigned Line, "Expected a scope and optional inlined-at"); // Set line and column. - assert(Line < (1u << 24) && "Expected 24-bit line"); assert(Column < (1u << 16) && "Expected 16-bit column"); SubclassData32 = Line; SubclassData16 = Column; } -static void adjustLine(unsigned &Line) { - // Set to unknown on overflow. Still use 24 bits for now. - if (Line >= (1u << 24)) - Line = 0; -} - static void adjustColumn(unsigned &Column) { // Set to unknown on overflow. We only have 16 bits to play with here. if (Column >= (1u << 16)) @@ -47,8 +40,7 @@ MDLocation *MDLocation::getImpl(LLVMContext &Context, unsigned Line, unsigned Column, Metadata *Scope, Metadata *InlinedAt, StorageType Storage, bool ShouldCreate) { - // Fixup line/column. - adjustLine(Line); + // Fixup column. adjustColumn(Column); if (Storage == Uniqued) { |