diff options
author | Jay Foad <jay.foad@amd.com> | 2025-01-16 17:19:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-16 17:19:41 +0000 |
commit | c10e8261bffd4cf8ec4bb48262c601dd54ecf2ce (patch) | |
tree | dc2fccd7e1f64e37982fc68c9d6da82c710fd43d /llvm/lib/FileCheck/FileCheck.cpp | |
parent | ebc7efbab5c58b46f7215d63be6d0208cb588192 (diff) | |
download | llvm-c10e8261bffd4cf8ec4bb48262c601dd54ecf2ce.zip llvm-c10e8261bffd4cf8ec4bb48262c601dd54ecf2ce.tar.gz llvm-c10e8261bffd4cf8ec4bb48262c601dd54ecf2ce.tar.bz2 |
[FileCheck] Remove unneeded unique_ptr. NFC. (#123216)
Diffstat (limited to 'llvm/lib/FileCheck/FileCheck.cpp')
-rw-r--r-- | llvm/lib/FileCheck/FileCheck.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/lib/FileCheck/FileCheck.cpp b/llvm/lib/FileCheck/FileCheck.cpp index b6c2838..a6df967 100644 --- a/llvm/lib/FileCheck/FileCheck.cpp +++ b/llvm/lib/FileCheck/FileCheck.cpp @@ -1766,8 +1766,7 @@ void FileCheckPatternContext::createLineVariable() { } FileCheck::FileCheck(FileCheckRequest Req) - : Req(Req), PatternContext(std::make_unique<FileCheckPatternContext>()), - CheckStrings(std::make_unique<std::vector<FileCheckString>>()) {} + : Req(Req), PatternContext(std::make_unique<FileCheckPatternContext>()) {} FileCheck::~FileCheck() = default; @@ -1916,7 +1915,7 @@ bool FileCheck::readCheckFile( // Verify that CHECK-NEXT/SAME/EMPTY lines have at least one CHECK line before them. if ((CheckTy == Check::CheckNext || CheckTy == Check::CheckSame || CheckTy == Check::CheckEmpty) && - CheckStrings->empty()) { + CheckStrings.empty()) { StringRef Type = CheckTy == Check::CheckNext ? "NEXT" : CheckTy == Check::CheckEmpty ? "EMPTY" : "SAME"; @@ -1934,8 +1933,8 @@ bool FileCheck::readCheckFile( } // Okay, add the string we captured to the output vector and move on. - CheckStrings->emplace_back(P, UsedPrefix, PatternLoc); - std::swap(DagNotMatches, CheckStrings->back().DagNotStrings); + CheckStrings.emplace_back(P, UsedPrefix, PatternLoc); + std::swap(DagNotMatches, CheckStrings.back().DagNotStrings); DagNotMatches = ImplicitNegativeChecks; } @@ -1962,10 +1961,10 @@ bool FileCheck::readCheckFile( // Add an EOF pattern for any trailing --implicit-check-not/CHECK-DAG/-NOTs, // and use the first prefix as a filler for the error message. if (!DagNotMatches.empty()) { - CheckStrings->emplace_back( + CheckStrings.emplace_back( Pattern(Check::CheckEOF, PatternContext.get(), LineNumber + 1), *Req.CheckPrefixes.begin(), SMLoc::getFromPointer(Buffer.data())); - std::swap(DagNotMatches, CheckStrings->back().DagNotStrings); + std::swap(DagNotMatches, CheckStrings.back().DagNotStrings); } return false; @@ -2676,13 +2675,13 @@ bool FileCheck::checkInput(SourceMgr &SM, StringRef Buffer, std::vector<FileCheckDiag> *Diags) { bool ChecksFailed = false; - unsigned i = 0, j = 0, e = CheckStrings->size(); + unsigned i = 0, j = 0, e = CheckStrings.size(); while (true) { StringRef CheckRegion; if (j == e) { CheckRegion = Buffer; } else { - const FileCheckString &CheckLabelStr = (*CheckStrings)[j]; + const FileCheckString &CheckLabelStr = CheckStrings[j]; if (CheckLabelStr.Pat.getCheckTy() != Check::CheckLabel) { ++j; continue; @@ -2708,7 +2707,7 @@ bool FileCheck::checkInput(SourceMgr &SM, StringRef Buffer, PatternContext->clearLocalVars(); for (; i != j; ++i) { - const FileCheckString &CheckStr = (*CheckStrings)[i]; + const FileCheckString &CheckStr = CheckStrings[i]; // Check each string within the scanned region, including a second check // of any final CHECK-LABEL (to verify CHECK-NOT and CHECK-DAG) |