Index: llvm/include/llvm/DebugInfo/PDB/DIA/DIASession.h =================================================================== --- llvm/include/llvm/DebugInfo/PDB/DIA/DIASession.h +++ llvm/include/llvm/DebugInfo/PDB/DIA/DIASession.h @@ -31,7 +31,7 @@ uint64_t getLoadAddress() const override; void setLoadAddress(uint64_t Address) override; - std::unique_ptr getGlobalScope() const override; + std::unique_ptr getGlobalScope() override; std::unique_ptr getSymbolById(uint32_t SymbolId) const override; std::unique_ptr Index: llvm/include/llvm/DebugInfo/PDB/IPDBSession.h =================================================================== --- llvm/include/llvm/DebugInfo/PDB/IPDBSession.h +++ llvm/include/llvm/DebugInfo/PDB/IPDBSession.h @@ -29,7 +29,7 @@ virtual uint64_t getLoadAddress() const = 0; virtual void setLoadAddress(uint64_t Address) = 0; - virtual std::unique_ptr getGlobalScope() const = 0; + virtual std::unique_ptr getGlobalScope() = 0; virtual std::unique_ptr getSymbolById(uint32_t SymbolId) const = 0; template Index: llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h =================================================================== --- llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h +++ llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h @@ -32,7 +32,7 @@ uint64_t getLoadAddress() const override; void setLoadAddress(uint64_t Address) override; - std::unique_ptr getGlobalScope() const override; + std::unique_ptr getGlobalScope() override; std::unique_ptr getSymbolById(uint32_t SymbolId) const override; std::unique_ptr Index: llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp =================================================================== --- llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp +++ llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp @@ -151,7 +151,7 @@ Session->put_loadAddress(Address); } -std::unique_ptr DIASession::getGlobalScope() const { +std::unique_ptr DIASession::getGlobalScope() { CComPtr GlobalScope; if (S_OK != Session->get_globalScope(&GlobalScope)) return nullptr; Index: llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp =================================================================== --- llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp +++ llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp @@ -70,12 +70,11 @@ void NativeSession::setLoadAddress(uint64_t Address) {} -std::unique_ptr NativeSession::getGlobalScope() const { - auto RawSymbol = - llvm::make_unique(const_cast(*this)); +std::unique_ptr NativeSession::getGlobalScope() { + auto RawSymbol = llvm::make_unique(*this); auto PdbSymbol(PDBSymbol::create(*this, std::move(RawSymbol))); std::unique_ptr ExeSymbol( - static_cast(PdbSymbol.release())); + static_cast(PdbSymbol.release())); return ExeSymbol; } Index: llvm/unittests/DebugInfo/PDB/PDBApiTest.cpp =================================================================== --- llvm/unittests/DebugInfo/PDB/PDBApiTest.cpp +++ llvm/unittests/DebugInfo/PDB/PDBApiTest.cpp @@ -63,9 +63,7 @@ class MockSession : public IPDBSession { uint64_t getLoadAddress() const override { return 0; } void setLoadAddress(uint64_t Address) override {} - std::unique_ptr getGlobalScope() const override { - return nullptr; - } + std::unique_ptr getGlobalScope() override { return nullptr; } std::unique_ptr getSymbolById(uint32_t SymbolId) const override { return nullptr; }