[llvm] r329712 - [PDB] Remove dead code and run clang format; NFC
Aaron Smith via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 10 08:25:04 PDT 2018
Author: asmith
Date: Tue Apr 10 08:25:04 2018
New Revision: 329712
URL: http://llvm.org/viewvc/llvm-project?rev=329712&view=rev
Log:
[PDB] Remove dead code and run clang format; NFC
Modified:
llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASectionContrib.h
llvm/trunk/lib/DebugInfo/PDB/DIA/DIASectionContrib.cpp
llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h?rev=329712&r1=329711&r2=329712&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h Tue Apr 10 08:25:04 2018
@@ -34,7 +34,7 @@ private:
const DIASession &Session;
CComPtr<IDiaEnumSectionContribs> Enumerator;
};
-}
-}
+} // namespace pdb
+} // namespace llvm
#endif // LLVM_DEBUGINFO_PDB_DIA_DIAENUMSECTIONCONTRIBS_H
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASectionContrib.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASectionContrib.h?rev=329712&r1=329711&r2=329712&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASectionContrib.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASectionContrib.h Tue Apr 10 08:25:04 2018
@@ -49,7 +49,7 @@ private:
const DIASession &Session;
CComPtr<IDiaSectionContrib> Section;
};
-}
-}
+} // namespace pdb
+} // namespace llvm
#endif // LLVM_DEBUGINFO_PDB_DIA_DIASECTIONCONTRIB_H
Modified: llvm/trunk/lib/DebugInfo/PDB/DIA/DIASectionContrib.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/DIA/DIASectionContrib.cpp?rev=329712&r1=329711&r2=329712&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/DIA/DIASectionContrib.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/DIA/DIASectionContrib.cpp Tue Apr 10 08:25:04 2018
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/DebugInfo/PDB/DIA/DIARawSymbol.h"
#include "llvm/DebugInfo/PDB/DIA/DIASectionContrib.h"
+#include "llvm/DebugInfo/PDB/DIA/DIARawSymbol.h"
#include "llvm/DebugInfo/PDB/DIA/DIASession.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
@@ -29,9 +29,9 @@ std::unique_ptr<PDBSymbolCompiland> DIAS
}
template <typename ArgType>
-ArgType PrivateGetDIAValue(
- IDiaSectionContrib *Section,
- HRESULT(__stdcall IDiaSectionContrib::*Method)(ArgType *)) {
+ArgType
+PrivateGetDIAValue(IDiaSectionContrib *Section,
+ HRESULT (__stdcall IDiaSectionContrib::*Method)(ArgType *)) {
ArgType Value;
if (S_OK == (Section->*Method)(&Value))
return static_cast<ArgType>(Value);
@@ -39,17 +39,6 @@ ArgType PrivateGetDIAValue(
return ArgType();
}
-template <typename ArgType, typename RetType>
-RetType PrivateGetDIAValue(
- IDiaSectionContrib *Section,
- HRESULT(__stdcall IDiaSectionContrib::*Method)(ArgType *)) {
- ArgType Value;
- if (S_OK == (Section->*Method)(&Value))
- return static_cast<RetType>(Value);
-
- return RetType();
-}
-
uint32_t DIASectionContrib::getAddressSection() const {
return PrivateGetDIAValue(Section, &IDiaSectionContrib::get_addressSection);
}
@@ -66,6 +55,7 @@ uint32_t DIASectionContrib::getRelativeV
return PrivateGetDIAValue(Section,
&IDiaSectionContrib::get_relativeVirtualAddress);
}
+
uint32_t DIASectionContrib::getLength() const {
return PrivateGetDIAValue(Section, &IDiaSectionContrib::get_length);
}
@@ -87,7 +77,8 @@ bool DIASectionContrib::hasInitializedDa
}
bool DIASectionContrib::hasUninitializedData() const {
- return PrivateGetDIAValue(Section, &IDiaSectionContrib::get_uninitializedData);
+ return PrivateGetDIAValue(Section,
+ &IDiaSectionContrib::get_uninitializedData);
}
bool DIASectionContrib::isRemoved() const {
Modified: llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp?rev=329712&r1=329711&r2=329712&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp Tue Apr 10 08:25:04 2018
@@ -1,4 +1,4 @@
-//===- PDBSymbolCompiland.cpp - compiland details --------*- C++ -*-===//
+//===- PDBSymbolCompiland.cpp - compiland details ---------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -11,8 +11,8 @@
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
-#include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h"
#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
#include "llvm/ADT/StringSwitch.h"
@@ -33,7 +33,7 @@ void PDBSymbolCompiland::dump(PDBSymDump
}
std::string PDBSymbolCompiland::getSourceFileName() const {
- return llvm::sys::path::filename(getSourceFileFullPath()).str();
+ return sys::path::filename(getSourceFileFullPath()).str();
}
std::string PDBSymbolCompiland::getSourceFileFullPath() const {
@@ -60,7 +60,7 @@ std::string PDBSymbolCompiland::getSourc
}
if (Var == "src") {
EnvSrc = Env->getValue();
- if (llvm::sys::path::is_absolute(EnvSrc))
+ if (sys::path::is_absolute(EnvSrc))
return EnvSrc;
RecordedResult = EnvSrc;
continue;
@@ -72,7 +72,7 @@ std::string PDBSymbolCompiland::getSourc
std::string Path = EnvWorkingDir + "\\" + EnvSrc;
std::replace(Path.begin(), Path.end(), '/', '\\');
// We will return it as full path if we can't find a better one.
- if (llvm::sys::path::is_absolute(Path))
+ if (sys::path::is_absolute(Path))
SourceFileFullPath = Path;
}
}
@@ -80,13 +80,12 @@ std::string PDBSymbolCompiland::getSourc
}
if (!RecordedResult.empty()) {
- if (llvm::sys::path::is_absolute(RecordedResult))
+ if (sys::path::is_absolute(RecordedResult))
return RecordedResult;
// This searches name that has same basename as the one in RecordedResult.
- auto OneSrcFile =
- Session.findOneSourceFile(this, RecordedResult,
- PDB_NameSearchFlags::NS_CaseInsensitive);
+ auto OneSrcFile = Session.findOneSourceFile(
+ this, RecordedResult, PDB_NameSearchFlags::NS_CaseInsensitive);
if (OneSrcFile)
return OneSrcFile->getFileName();
}
@@ -101,14 +100,14 @@ std::string PDBSymbolCompiland::getSourc
bool LangC = (Lang == PDB_Lang::Cpp || Lang == PDB_Lang::C);
while (auto File = SrcFiles->getNext()) {
std::string FileName = File->getFileName();
- auto file_extension = llvm::sys::path::extension(FileName);
+ auto file_extension = sys::path::extension(FileName);
if (StringSwitch<bool>(file_extension.lower())
- .Case(".cpp", LangC)
- .Case(".c", LangC)
- .Case(".cc", LangC)
- .Case(".cxx", LangC)
- .Case(".asm", Lang == PDB_Lang::Masm)
- .Default(false))
+ .Case(".cpp", LangC)
+ .Case(".c", LangC)
+ .Case(".cc", LangC)
+ .Case(".cxx", LangC)
+ .Case(".asm", Lang == PDB_Lang::Masm)
+ .Default(false))
return File->getFileName();
}
}
More information about the llvm-commits
mailing list