summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-02 17:05:19 +0000
committerZachary Turner <zturner@google.com>2016-11-02 17:05:19 +0000
commit7251ede7c5ee82d25e309b6a30952a6b5e7c1f89 (patch)
tree3b4fb352c4fb41db708e3778d3e1aef75a47eed0 /llvm/lib/CodeGen
parent368972c3b3b8ad62fa064b495223809074c39115 (diff)
downloadbcm5719-llvm-7251ede7c5ee82d25e309b6a30952a6b5e7c1f89.tar.gz
bcm5719-llvm-7251ede7c5ee82d25e309b6a30952a6b5e7c1f89.zip
Add CodeViewRecordIO for reading and writing.
Using a pattern similar to that of YamlIO, this allows us to have a single codepath for translating codeview records to and from serialized byte streams. The current patch only hooks this up to the reading of CodeView type records. A subsequent patch will hook it up for writing of CodeView type records, and then a third patch will hook up the reading and writing of CodeView symbols. Differential Revision: https://reviews.llvm.org/D26040 llvm-svn: 285836
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 5cc8b4e4555..fc691456a48 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -1690,9 +1690,9 @@ TypeIndex CodeViewDebug::lowerTypeClass(const DICompositeType *Ty) {
ClassOptions CO =
ClassOptions::ForwardReference | getCommonClassOptions(Ty);
std::string FullName = getFullyQualifiedName(Ty);
- TypeIndex FwdDeclTI = TypeTable.writeKnownType(ClassRecord(
- Kind, 0, CO, HfaKind::None, WindowsRTClassKind::None, TypeIndex(),
- TypeIndex(), TypeIndex(), 0, FullName, Ty->getIdentifier()));
+ TypeIndex FwdDeclTI = TypeTable.writeKnownType(
+ ClassRecord(Kind, 0, CO, TypeIndex(), TypeIndex(), TypeIndex(), 0,
+ FullName, Ty->getIdentifier()));
if (!Ty->isForwardDecl())
DeferredCompleteTypes.push_back(Ty);
return FwdDeclTI;
@@ -1716,9 +1716,9 @@ TypeIndex CodeViewDebug::lowerCompleteTypeClass(const DICompositeType *Ty) {
uint64_t SizeInBytes = Ty->getSizeInBits() / 8;
- TypeIndex ClassTI = TypeTable.writeKnownType(ClassRecord(
- Kind, FieldCount, CO, HfaKind::None, WindowsRTClassKind::None, FieldTI,
- TypeIndex(), VShapeTI, SizeInBytes, FullName, Ty->getIdentifier()));
+ TypeIndex ClassTI = TypeTable.writeKnownType(
+ ClassRecord(Kind, FieldCount, CO, FieldTI, TypeIndex(), VShapeTI,
+ SizeInBytes, FullName, Ty->getIdentifier()));
TypeTable.writeKnownType(UdtSourceLineRecord(
ClassTI, TypeTable.writeKnownType(StringIdRecord(
@@ -1734,8 +1734,8 @@ TypeIndex CodeViewDebug::lowerTypeUnion(const DICompositeType *Ty) {
ClassOptions CO =
ClassOptions::ForwardReference | getCommonClassOptions(Ty);
std::string FullName = getFullyQualifiedName(Ty);
- TypeIndex FwdDeclTI = TypeTable.writeKnownType(UnionRecord(
- 0, CO, HfaKind::None, TypeIndex(), 0, FullName, Ty->getIdentifier()));
+ TypeIndex FwdDeclTI = TypeTable.writeKnownType(
+ UnionRecord(0, CO, TypeIndex(), 0, FullName, Ty->getIdentifier()));
if (!Ty->isForwardDecl())
DeferredCompleteTypes.push_back(Ty);
return FwdDeclTI;
@@ -1755,9 +1755,8 @@ TypeIndex CodeViewDebug::lowerCompleteTypeUnion(const DICompositeType *Ty) {
uint64_t SizeInBytes = Ty->getSizeInBits() / 8;
std::string FullName = getFullyQualifiedName(Ty);
- TypeIndex UnionTI = TypeTable.writeKnownType(
- UnionRecord(FieldCount, CO, HfaKind::None, FieldTI, SizeInBytes, FullName,
- Ty->getIdentifier()));
+ TypeIndex UnionTI = TypeTable.writeKnownType(UnionRecord(
+ FieldCount, CO, FieldTI, SizeInBytes, FullName, Ty->getIdentifier()));
TypeTable.writeKnownType(UdtSourceLineRecord(
UnionTI, TypeTable.writeKnownType(StringIdRecord(
@@ -1858,11 +1857,10 @@ CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) {
if (Introduced)
VFTableOffset = SP->getVirtualIndex() * getPointerSizeInBytes();
- Methods.push_back(
- OneMethodRecord(MethodType, translateMethodKindFlags(SP, Introduced),
- translateMethodOptionFlags(SP),
- translateAccessFlags(Ty->getTag(), SP->getFlags()),
- VFTableOffset, Name));
+ Methods.push_back(OneMethodRecord(
+ MethodType, translateAccessFlags(Ty->getTag(), SP->getFlags()),
+ translateMethodKindFlags(SP, Introduced),
+ translateMethodOptionFlags(SP), VFTableOffset, Name));
MemberCount++;
}
assert(Methods.size() > 0 && "Empty methods map entry");
OpenPOWER on IntegriCloud