mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 04:14:03 +08:00
[clang-tools-extra] Remove unused local variables (NFC) (#139382)
This commit is contained in:
@@ -124,7 +124,6 @@ class DumpVisitor : public RecursiveASTVisitor<DumpVisitor> {
|
||||
return Result;
|
||||
}
|
||||
std::string getKind(const TypeLoc &TL) {
|
||||
std::string Result;
|
||||
if (TL.getTypeLocClass() == TypeLoc::Qualified)
|
||||
return "Qualified";
|
||||
return TL.getType()->getTypeClassName();
|
||||
|
||||
@@ -433,7 +433,6 @@ TEST(SerializationTest, NoCrashOnBadStringTableSize) {
|
||||
std::string CorruptStri =
|
||||
(llvm::fromHex("ffffffff") + Stri->Data.drop_front(4)).str();
|
||||
Stri->Data = CorruptStri;
|
||||
std::string FileDigest = llvm::fromHex("EED8F5EAF25C453C");
|
||||
|
||||
// Try to crash rather than hang on large allocation.
|
||||
ScopedMemoryLimit MemLimit(1000 * 1024 * 1024); // 1GB
|
||||
|
||||
@@ -344,7 +344,6 @@ mapInputsToAbsPaths(clang::tooling::CompilationDatabase &CDB,
|
||||
}
|
||||
for (const auto &Cmd : Cmds) {
|
||||
llvm::SmallString<256> CDBPath(Cmd.Filename);
|
||||
std::string Directory(Cmd.Directory);
|
||||
llvm::sys::fs::make_absolute(Cmd.Directory, CDBPath);
|
||||
CDBToAbsPaths[std::string(CDBPath)] = std::string(AbsPath);
|
||||
}
|
||||
|
||||
@@ -360,8 +360,6 @@ getModularizeArgumentsAdjuster(DependencyMap &Dependencies) {
|
||||
if (int Count = FileDependents.size()) {
|
||||
for (int Index = 0; Index < Count; ++Index) {
|
||||
NewArgs.push_back("-include");
|
||||
std::string File(std::string("\"") + FileDependents[Index] +
|
||||
std::string("\""));
|
||||
NewArgs.push_back(FileDependents[Index]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,7 +381,6 @@ static std::string getMacroUnexpandedString(clang::SourceRange Range,
|
||||
clang::SourceLocation BeginLoc(Range.getBegin());
|
||||
const char *BeginPtr = PP.getSourceManager().getCharacterData(BeginLoc);
|
||||
size_t Length;
|
||||
std::string Unexpanded;
|
||||
if (MI->isFunctionLike()) {
|
||||
clang::SourceLocation EndLoc(Range.getEnd());
|
||||
const char *EndPtr = PP.getSourceManager().getCharacterData(EndLoc) + 1;
|
||||
@@ -1328,7 +1327,6 @@ void PreprocessorCallbacks::Defined(const clang::Token &MacroNameTok,
|
||||
clang::SourceLocation Loc(Range.getBegin());
|
||||
clang::IdentifierInfo *II = MacroNameTok.getIdentifierInfo();
|
||||
const clang::MacroInfo *MI = MD.getMacroInfo();
|
||||
std::string MacroName = II->getName().str();
|
||||
std::string Unexpanded(getSourceString(PP, Range));
|
||||
PPTracker.addMacroExpansionInstance(
|
||||
PP, PPTracker.getCurrentHeaderHandle(), Loc,
|
||||
|
||||
Reference in New Issue
Block a user