summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-16 17:33:08 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-16 17:33:08 +0000
commit2f5bb31302fb5f09b997fe5b3b7474665eab6141 (patch)
tree137013d010e9ba832a2692b59f716a067844612b /llvm/lib
parentc9cddb083746c5a52f87f52f17d2555e0ead9422 (diff)
downloadbcm5719-llvm-2f5bb31302fb5f09b997fe5b3b7474665eab6141.tar.gz
bcm5719-llvm-2f5bb31302fb5f09b997fe5b3b7474665eab6141.zip
IR: Allow 16-bits for column info
Raise the limit for column information from 8 bits to 16 bits. llvm-svn: 226291
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp2
-rw-r--r--llvm/lib/IR/Metadata.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index d209a2087dd..11a5983c8ad 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -3002,7 +3002,7 @@ bool LLParser::ParseSpecializedMDNode(MDNode *&N, bool IsDistinct) {
/// ::= !MDLocation(line: 43, column: 8, scope: !5, inlinedAt: !6)
bool LLParser::ParseMDLocation(MDNode *&Result, bool IsDistinct) {
MDUnsignedField<uint32_t> line(0, ~0u >> 8);
- MDUnsignedField<uint32_t> column(0, ~0u >> 24);
+ MDUnsignedField<uint32_t> column(0, ~0u >> 16);
MDField scope;
MDField inlinedAt;
if (ParseMDFieldsImpl([&]() -> bool {
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 2c6b332dc8e..de204d58764 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -653,7 +653,7 @@ MDLocation::MDLocation(LLVMContext &C, unsigned Line, unsigned Column,
// Set line and column.
assert(Line < (1u << 24) && "Expected 24-bit line");
- assert(Column < (1u << 8) && "Expected 8-bit column");
+ assert(Column < (1u << 16) && "Expected 16-bit column");
MDNodeSubclassData = Line;
SubclassData16 = Column;
@@ -676,8 +676,8 @@ static void adjustLine(unsigned &Line) {
}
static void adjustColumn(unsigned &Column) {
- // Set to unknown on overflow. Still use 8 bits for now.
- if (Column >= (1u << 8))
+ // Set to unknown on overflow. We only have 16 bits to play with here.
+ if (Column >= (1u << 16))
Column = 0;
}
OpenPOWER on IntegriCloud