[clang-tools-extra] Remove unused local variables (NFC) (#139382)

This commit is contained in:
Kazu Hirata
2025-05-10 09:30:54 -07:00
committed by GitHub
parent 369891b674
commit 4b6762b0d4
5 changed files with 0 additions and 7 deletions

View File

@@ -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();

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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]);
}
}

View File

@@ -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,