llvm/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp
Zachary Turner 5e117855c3 [msf] Resubmit "Rename Msf -> MSF".
Previously this change was submitted from a Windows machine, so
changes made to the case of filenames and directory names did
not survive the commit, and as a result the CMake source file
names and the on-disk file names did not match on case-sensitive
file systems.

I'm resubmitting this patch from a Linux system, which hopefully
allows the case changes to make it through unfettered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 20:56:36 +00:00

109 lines
4.5 KiB
C++

//===- ModuleSubstreamVisitor.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/ModuleSubstreamVisitor.h"
#include "llvm/DebugInfo/MSF/StreamReader.h"
#include "llvm/DebugInfo/MSF/StreamRef.h"
using namespace llvm;
using namespace llvm::codeview;
using namespace llvm::msf;
Error IModuleSubstreamVisitor::visitSymbols(ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::Symbols, Data);
}
Error IModuleSubstreamVisitor::visitLines(ReadableStreamRef Data,
const LineSubstreamHeader *Header,
const LineInfoArray &Lines) {
return visitUnknown(ModuleSubstreamKind::Lines, Data);
}
Error IModuleSubstreamVisitor::visitStringTable(ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::StringTable, Data);
}
Error IModuleSubstreamVisitor::visitFileChecksums(
ReadableStreamRef Data, const FileChecksumArray &Checksums) {
return visitUnknown(ModuleSubstreamKind::FileChecksums, Data);
}
Error IModuleSubstreamVisitor::visitFrameData(ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::FrameData, Data);
}
Error IModuleSubstreamVisitor::visitInlineeLines(ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::InlineeLines, Data);
}
Error IModuleSubstreamVisitor::visitCrossScopeImports(ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::CrossScopeExports, Data);
}
Error IModuleSubstreamVisitor::visitCrossScopeExports(ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::CrossScopeImports, Data);
}
Error IModuleSubstreamVisitor::visitILLines(ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::ILLines, Data);
}
Error IModuleSubstreamVisitor::visitFuncMDTokenMap(ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::FuncMDTokenMap, Data);
}
Error IModuleSubstreamVisitor::visitTypeMDTokenMap(ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::TypeMDTokenMap, Data);
}
Error IModuleSubstreamVisitor::visitMergedAssemblyInput(
ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::MergedAssemblyInput, Data);
}
Error IModuleSubstreamVisitor::visitCoffSymbolRVA(ReadableStreamRef Data) {
return visitUnknown(ModuleSubstreamKind::CoffSymbolRVA, Data);
}
Error llvm::codeview::visitModuleSubstream(const ModuleSubstream &R,
IModuleSubstreamVisitor &V) {
switch (R.getSubstreamKind()) {
case ModuleSubstreamKind::Symbols:
return V.visitSymbols(R.getRecordData());
case ModuleSubstreamKind::Lines: {
StreamReader Reader(R.getRecordData());
const LineSubstreamHeader *Header;
if (auto EC = Reader.readObject(Header))
return EC;
VarStreamArrayExtractor<LineColumnEntry> E(Header);
LineInfoArray LineInfos(E);
if (auto EC = Reader.readArray(LineInfos, Reader.bytesRemaining()))
return EC;
return V.visitLines(R.getRecordData(), Header, LineInfos);
}
case ModuleSubstreamKind::StringTable:
return V.visitStringTable(R.getRecordData());
case ModuleSubstreamKind::FileChecksums: {
StreamReader Reader(R.getRecordData());
FileChecksumArray Checksums;
if (auto EC = Reader.readArray(Checksums, Reader.bytesRemaining()))
return EC;
return V.visitFileChecksums(R.getRecordData(), Checksums);
}
case ModuleSubstreamKind::FrameData:
return V.visitFrameData(R.getRecordData());
case ModuleSubstreamKind::InlineeLines:
return V.visitInlineeLines(R.getRecordData());
case ModuleSubstreamKind::CrossScopeImports:
return V.visitCrossScopeImports(R.getRecordData());
case ModuleSubstreamKind::CrossScopeExports:
return V.visitCrossScopeExports(R.getRecordData());
case ModuleSubstreamKind::ILLines:
return V.visitILLines(R.getRecordData());
case ModuleSubstreamKind::FuncMDTokenMap:
return V.visitFuncMDTokenMap(R.getRecordData());
case ModuleSubstreamKind::TypeMDTokenMap:
return V.visitTypeMDTokenMap(R.getRecordData());
case ModuleSubstreamKind::MergedAssemblyInput:
return V.visitMergedAssemblyInput(R.getRecordData());
case ModuleSubstreamKind::CoffSymbolRVA:
return V.visitCoffSymbolRVA(R.getRecordData());
default:
return V.visitUnknown(R.getSubstreamKind(), R.getRecordData());
}
}