summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorNilanjana Basu <nilanjana.basu87@gmail.com>2019-07-03 00:51:49 +0000
committerNilanjana Basu <nilanjana.basu87@gmail.com>2019-07-03 00:51:49 +0000
commitc0b557744a7d8d87a7e5dd0364b168648d408ea9 (patch)
treefd6daf6e8a6a3a58187ed2b40601fc3b3e7e8054 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parentefe21088d76c091a29bc7990ef9cf502e1f1bf62 (diff)
downloadbcm5719-llvm-c0b557744a7d8d87a7e5dd0364b168648d408ea9.tar.gz
bcm5719-llvm-c0b557744a7d8d87a7e5dd0364b168648d408ea9.zip
Revert Changing CodeView debug info type record representation in assembly files to make it more human-readable & editable
This reverts r364982 (git commit 2082bf28ebea76cc187b508f801122866420d9ff) llvm-svn: 364987
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp49
1 files changed, 8 insertions, 41 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 61fe6984338..9f8ed86b50e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -51,7 +51,6 @@
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
#include "llvm/DebugInfo/CodeView/TypeTableCollection.h"
-#include "llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h"
@@ -95,24 +94,6 @@
using namespace llvm;
using namespace llvm::codeview;
-namespace {
-class CVMCAdapter : public CodeViewRecordStreamer {
-public:
- CVMCAdapter(MCStreamer &OS) : OS(&OS) {}
-
- void EmitBytes(StringRef Data) { OS->EmitBytes(Data); }
-
- void EmitIntValue(uint64_t Value, unsigned Size) {
- OS->EmitIntValue(Value, Size);
- }
-
- void EmitBinaryData(StringRef Data) { OS->EmitBinaryData(Data); }
-
-private:
- MCStreamer *OS = nullptr;
-};
-} // namespace
-
static CPUType mapArchToCVCPUType(Triple::ArchType Type) {
switch (Type) {
case Triple::ArchType::x86:
@@ -636,40 +617,26 @@ void CodeViewDebug::emitTypeInformation() {
// This will fail if the record data is invalid.
CVType Record = Table.getType(*B);
- TypeVisitorCallbackPipeline Pipeline;
- CVMCAdapter CVMCOS(OS);
- TypeRecordMapping typeMapping(CVMCOS);
- SmallString<512> CommentBlock;
- raw_svector_ostream CommentOS(CommentBlock);
-
if (OS.isVerboseAsm()) {
// Emit a block comment describing the type record for readability.
+ SmallString<512> CommentBlock;
+ raw_svector_ostream CommentOS(CommentBlock);
ScopedPrinter SP(CommentOS);
SP.setPrefix(CommentPrefix);
TypeDumpVisitor TDV(Table, &SP, false);
- Pipeline.addCallbackToPipeline(TDV);
- }
- Pipeline.addCallbackToPipeline(typeMapping);
-
- auto RecordLen = Record.length();
- auto RecordKind = Record.kind();
- OS.EmitIntValue(RecordLen - 2, 2);
- OS.EmitIntValue(RecordKind, sizeof(RecordKind));
-
- Error E = codeview::visitTypeRecord(Record, *B, Pipeline);
- if (E) {
- logAllUnhandledErrors(std::move(E), errs(), "error: ");
- llvm_unreachable("produced malformed type record");
- }
-
- if (OS.isVerboseAsm()) {
+ Error E = codeview::visitTypeRecord(Record, *B, TDV);
+ if (E) {
+ logAllUnhandledErrors(std::move(E), errs(), "error: ");
+ llvm_unreachable("produced malformed type record");
+ }
// emitRawComment will insert its own tab and comment string before
// the first line, so strip off our first one. It also prints its own
// newline.
OS.emitRawComment(
CommentOS.str().drop_front(CommentPrefix.size() - 1).rtrim());
}
+ OS.EmitBinaryData(Record.str_data());
B = Table.getNext(*B);
}
}
OpenPOWER on IntegriCloud