aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-09-09 18:03:39 +0000
committerZachary Turner <zturner@google.com>2016-09-09 18:03:39 +0000
commit9ba31a5efe21d13030a889113d4e062b9ddf2eef (patch)
treefbd28f9d9e15e455d1cdcd25ecb62538edd43715 /llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
parent00ef27112e267b5fb912b30010f11719fbbe74cc (diff)
downloadllvm-9ba31a5efe21d13030a889113d4e062b9ddf2eef.zip
llvm-9ba31a5efe21d13030a889113d4e062b9ddf2eef.tar.gz
llvm-9ba31a5efe21d13030a889113d4e062b9ddf2eef.tar.bz2
[pdb] Pass CVRecord's through the visitor as non-const references.
This simplifies a lot of code, and will actually be necessary for an upcoming patch to serialize TPI record hash values. The idea before was that visitors should be examining records, not modifying them. But this is no longer true with a visitor that constructs a CVRecord from Yaml. To handle this until now, we were doing some fixups on CVRecord objects at a higher level, but the code is really awkward, and it makes sense to just have the visitor write the bytes into the CVRecord. In doing so I uncovered a few bugs related to `Data` and `RawData` and fixed those. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D24362 llvm-svn: 281067
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
index ce645eb..5560643 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp
@@ -69,34 +69,33 @@ public:
uint32_t NumHashBuckets)
: HashValues(HashValues), NumHashBuckets(NumHashBuckets) {}
- Error visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
+ Error visitKnownRecord(CVRecord<TypeLeafKind> &CVR,
UdtSourceLineRecord &Rec) override {
return verifySourceLine(Rec);
}
- Error visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
+ Error visitKnownRecord(CVRecord<TypeLeafKind> &CVR,
UdtModSourceLineRecord &Rec) override {
return verifySourceLine(Rec);
}
- Error visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
+ Error visitKnownRecord(CVRecord<TypeLeafKind> &CVR,
ClassRecord &Rec) override {
return verify(Rec);
}
- Error visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
+ Error visitKnownRecord(CVRecord<TypeLeafKind> &CVR,
EnumRecord &Rec) override {
return verify(Rec);
}
- Error visitKnownRecord(const CVRecord<TypeLeafKind> &CVR,
+ Error visitKnownRecord(CVRecord<TypeLeafKind> &CVR,
UnionRecord &Rec) override {
return verify(Rec);
}
- Expected<TypeLeafKind>
- visitTypeBegin(const CVRecord<TypeLeafKind> &Rec) override {
+ Error visitTypeBegin(CVRecord<TypeLeafKind> &Rec) override {
++Index;
RawRecord = Rec;
- return Rec.Type;
+ return Error::success();
}
private: