summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
diff options
context:
space:
mode:
authorAdrian McCarthy <amccarth@google.com>2017-06-22 18:42:23 +0000
committerAdrian McCarthy <amccarth@google.com>2017-06-22 18:42:23 +0000
commit6a4b080a5f10f873e163eb526e499a75accea3a2 (patch)
treea548408d6e9a9bd0c3034a99247d587e6c5c8b8e /llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
parent41a34e411164468818aad59000f41fce9ccbe018 (diff)
downloadbcm5719-llvm-6a4b080a5f10f873e163eb526e499a75accea3a2.tar.gz
bcm5719-llvm-6a4b080a5f10f873e163eb526e499a75accea3a2.zip
Make IPDBSession::getGlobalScope a non-const method
There doesn't seem to be a compelling reason why this method should be const other than it was possible with the DIA implementation. The native session is going to act as a symbol factory and cache. This could be acheived with mutable (and the existing const_cast), but it seems cleaner to accept that this method affects the state of the session. This change eliminates an existing const_cast. llvm-svn: 306041
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
index 7e6843bceb7..c59cf866d1c 100644
--- a/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
@@ -70,12 +70,11 @@ uint64_t NativeSession::getLoadAddress() const { return 0; }
void NativeSession::setLoadAddress(uint64_t Address) {}
-std::unique_ptr<PDBSymbolExe> NativeSession::getGlobalScope() const {
- auto RawSymbol =
- llvm::make_unique<NativeExeSymbol>(const_cast<NativeSession &>(*this));
+std::unique_ptr<PDBSymbolExe> NativeSession::getGlobalScope() {
+ auto RawSymbol = llvm::make_unique<NativeExeSymbol>(*this);
auto PdbSymbol(PDBSymbol::create(*this, std::move(RawSymbol)));
std::unique_ptr<PDBSymbolExe> ExeSymbol(
- static_cast<PDBSymbolExe *>(PdbSymbol.release()));
+ static_cast<PDBSymbolExe *>(PdbSymbol.release()));
return ExeSymbol;
}
OpenPOWER on IntegriCloud