summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-15 22:29:27 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-15 22:29:27 +0000
commit62e0f454a03d4989c1646563ba2e8d87c5753964 (patch)
tree91db3029c5d0fb66ec7991cfb41c415af55f6fd0 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent4bdc50eccb1d41bc51232a55e734a70da8ae5ee2 (diff)
downloadbcm5719-llvm-62e0f454a03d4989c1646563ba2e8d87c5753964.tar.gz
bcm5719-llvm-62e0f454a03d4989c1646563ba2e8d87c5753964.zip
DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable
Remove 'inlinedAt:' from MDLocalVariable. Besides saving some memory (variables with it seem to be single largest `Metadata` contributer to memory usage right now in -g -flto builds), this stops optimization and backend passes from having to change local variables. The 'inlinedAt:' field was used by the backend in two ways: 1. To tell the backend whether and into what a variable was inlined. 2. To create a unique id for each inlined variable. Instead, rely on the 'inlinedAt:' field of the intrinsic's `!dbg` attachment, and change the DWARF backend to use a typedef called `InlinedVariable` which is `std::pair<MDLocalVariable*, MDLocation*>`. This `DebugLoc` is already passed reliably through the backend (as verified by r234021). This commit removes the check from r234021, but I added a new check (that will survive) in r235048, and changed the `DIBuilder` API in r235041 to require a `!dbg` attachment whose 'scope:` is in the same `MDSubprogram` as the variable's. If this breaks your out-of-tree testcases, perhaps the script I used (mdlocalvariable-drop-inlinedat.sh) will help; I'll attach it to PR22778 in a moment. llvm-svn: 235050
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index bd4d70b25aa..6caec344d1f 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1911,7 +1911,8 @@ std::error_code BitcodeReader::ParseMetadata() {
break;
}
case bitc::METADATA_LOCAL_VAR: {
- if (Record.size() != 10)
+ // 10th field is for the obseleted 'inlinedAt:' field.
+ if (Record.size() != 9 && Record.size() != 10)
return Error("Invalid record");
MDValueList.AssignValue(
@@ -1919,7 +1920,7 @@ std::error_code BitcodeReader::ParseMetadata() {
(Context, Record[1], getMDOrNull(Record[2]),
getMDString(Record[3]), getMDOrNull(Record[4]),
Record[5], getMDOrNull(Record[6]), Record[7],
- Record[8], getMDOrNull(Record[9]))),
+ Record[8])),
NextMDValueNo++);
break;
}
OpenPOWER on IntegriCloud