teak-llvm/llvm/lib/DebugInfo/PDB/Native/NativeCompilandSymbol.cpp
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00

61 lines
2.2 KiB
C++

//===- NativeCompilandSymbol.cpp - Native impl for compilands ---*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h"
#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
#include "llvm/ADT/STLExtras.h"
namespace llvm {
namespace pdb {
NativeCompilandSymbol::NativeCompilandSymbol(NativeSession &Session,
SymIndexId SymbolId,
DbiModuleDescriptor MI)
: NativeRawSymbol(Session, PDB_SymType::Compiland, SymbolId), Module(MI) {}
PDB_SymType NativeCompilandSymbol::getSymTag() const {
return PDB_SymType::Compiland;
}
void NativeCompilandSymbol::dump(raw_ostream &OS, int Indent,
PdbSymbolIdField ShowIdFields,
PdbSymbolIdField RecurseIdFields) const {
NativeRawSymbol::dump(OS, Indent, ShowIdFields, RecurseIdFields);
dumpSymbolIdField(OS, "lexicalParentId", 0, Indent, Session,
PdbSymbolIdField::LexicalParent, ShowIdFields,
RecurseIdFields);
dumpSymbolField(OS, "libraryName", getLibraryName(), Indent);
dumpSymbolField(OS, "name", getName(), Indent);
dumpSymbolField(OS, "editAndContinueEnabled", isEditAndContinueEnabled(),
Indent);
}
bool NativeCompilandSymbol::isEditAndContinueEnabled() const {
return Module.hasECInfo();
}
SymIndexId NativeCompilandSymbol::getLexicalParentId() const { return 0; }
// The usage of getObjFileName for getLibraryName and getModuleName for getName
// may seem backwards, but it is consistent with DIA, which is what this API
// was modeled after. We may rename these methods later to try to eliminate
// this potential confusion.
std::string NativeCompilandSymbol::getLibraryName() const {
return Module.getObjFileName();
}
std::string NativeCompilandSymbol::getName() const {
return Module.getModuleName();
}
} // namespace pdb
} // namespace llvm