2017-04-27 16:11:19 +00:00
|
|
|
//===- ModuleDebugFragmentVisitor.cpp ---------------------------*- C++ -*-===//
|
|
|
|
|
//
|
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
|
//
|
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
#include "llvm/DebugInfo/CodeView/ModuleDebugFragmentVisitor.h"
|
2017-04-27 16:12:16 +00:00
|
|
|
|
|
|
|
|
#include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h"
|
2017-04-29 01:13:21 +00:00
|
|
|
#include "llvm/DebugInfo/CodeView/ModuleDebugFragmentRecord.h"
|
2017-05-02 16:56:09 +00:00
|
|
|
#include "llvm/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.h"
|
2017-04-27 16:12:16 +00:00
|
|
|
#include "llvm/DebugInfo/CodeView/ModuleDebugLineFragment.h"
|
2017-04-29 01:13:21 +00:00
|
|
|
#include "llvm/DebugInfo/CodeView/ModuleDebugUnknownFragment.h"
|
2017-04-27 16:11:19 +00:00
|
|
|
#include "llvm/Support/BinaryStreamReader.h"
|
|
|
|
|
#include "llvm/Support/BinaryStreamRef.h"
|
|
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
using namespace llvm::codeview;
|
|
|
|
|
|
2017-04-27 16:12:16 +00:00
|
|
|
Error llvm::codeview::visitModuleDebugFragment(
|
|
|
|
|
const ModuleDebugFragmentRecord &R, ModuleDebugFragmentVisitor &V) {
|
|
|
|
|
BinaryStreamReader Reader(R.getRecordData());
|
2017-04-27 16:11:19 +00:00
|
|
|
switch (R.kind()) {
|
|
|
|
|
case ModuleDebugFragmentKind::Lines: {
|
2017-05-01 16:46:39 +00:00
|
|
|
ModuleDebugLineFragmentRef Fragment;
|
2017-04-27 16:12:16 +00:00
|
|
|
if (auto EC = Fragment.initialize(Reader))
|
2017-04-27 16:11:19 +00:00
|
|
|
return EC;
|
2017-04-27 16:12:16 +00:00
|
|
|
|
|
|
|
|
return V.visitLines(Fragment);
|
2017-04-27 16:11:19 +00:00
|
|
|
}
|
|
|
|
|
case ModuleDebugFragmentKind::FileChecksums: {
|
2017-05-01 16:46:39 +00:00
|
|
|
ModuleDebugFileChecksumFragmentRef Fragment;
|
2017-04-27 16:12:16 +00:00
|
|
|
if (auto EC = Fragment.initialize(Reader))
|
2017-04-27 16:11:19 +00:00
|
|
|
return EC;
|
2017-04-27 16:12:16 +00:00
|
|
|
|
|
|
|
|
return V.visitFileChecksums(Fragment);
|
|
|
|
|
}
|
2017-05-02 16:56:09 +00:00
|
|
|
case ModuleDebugFragmentKind::InlineeLines: {
|
|
|
|
|
ModuleDebugInlineeLineFragmentRef Fragment;
|
|
|
|
|
if (auto EC = Fragment.initialize(Reader))
|
|
|
|
|
return EC;
|
|
|
|
|
return V.visitInlineeLines(Fragment);
|
|
|
|
|
}
|
2017-04-27 16:12:16 +00:00
|
|
|
default: {
|
2017-05-01 16:46:39 +00:00
|
|
|
ModuleDebugUnknownFragmentRef Fragment(R.kind(), R.getRecordData());
|
2017-04-27 16:12:16 +00:00
|
|
|
return V.visitUnknown(Fragment);
|
2017-04-27 16:11:19 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|