llvm/lib/DebugInfo/CodeView/ModuleDebugFragmentVisitor.cpp
Zachary Turner 3b718709c4 [PDB/CodeView] Rename some classes.
In preparation for introducing writing capabilities for each of
these classes, I would like to adopt a Foo / FooRef naming
convention, where Foo indicates that the class can manipulate and
serialize Foos, and FooRef indicates that it is an immutable view of
an existing Foo.  In other words, Foo is a writer and FooRef is a
reader.  This patch names some existing readers to conform to the
FooRef convention, while offering no functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-01 16:46:39 +00:00

46 lines
1.5 KiB
C++

//===- 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"
#include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h"
#include "llvm/DebugInfo/CodeView/ModuleDebugFragmentRecord.h"
#include "llvm/DebugInfo/CodeView/ModuleDebugLineFragment.h"
#include "llvm/DebugInfo/CodeView/ModuleDebugUnknownFragment.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/BinaryStreamRef.h"
using namespace llvm;
using namespace llvm::codeview;
Error llvm::codeview::visitModuleDebugFragment(
const ModuleDebugFragmentRecord &R, ModuleDebugFragmentVisitor &V) {
BinaryStreamReader Reader(R.getRecordData());
switch (R.kind()) {
case ModuleDebugFragmentKind::Lines: {
ModuleDebugLineFragmentRef Fragment;
if (auto EC = Fragment.initialize(Reader))
return EC;
return V.visitLines(Fragment);
}
case ModuleDebugFragmentKind::FileChecksums: {
ModuleDebugFileChecksumFragmentRef Fragment;
if (auto EC = Fragment.initialize(Reader))
return EC;
return V.visitFileChecksums(Fragment);
}
default: {
ModuleDebugUnknownFragmentRef Fragment(R.kind(), R.getRecordData());
return V.visitUnknown(Fragment);
}
}
}