Skip to content

Commit a1b0b49

Browse files
authored
[SandboxVec][NFC] Replace std::regex with llvm::Regex (#134110)
1 parent a858565 commit a1b0b49

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#include "llvm/IR/Module.h"
1212
#include "llvm/SandboxIR/Constant.h"
1313
#include "llvm/Support/CommandLine.h"
14+
#include "llvm/Support/Regex.h"
1415
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h"
1516
#include "llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.h"
16-
#include <regex>
1717

1818
using namespace llvm;
1919

@@ -92,8 +92,9 @@ bool SandboxVectorizerPass::allowFile(const std::string &SrcFilePath) {
9292
if (FileNameToMatch.empty())
9393
return false;
9494
// Note: This only runs when debugging so its OK not to reuse the regex.
95-
std::regex FileNameRegex(std::string(".*") + FileNameToMatch);
96-
if (std::regex_match(SrcFilePath, FileNameRegex))
95+
Regex FileNameRegex(".*" + FileNameToMatch + "$");
96+
assert(FileNameRegex.isValid() && "Bad regex!");
97+
if (FileNameRegex.match(SrcFilePath))
9798
return true;
9899
} while (DelimPos != std::string::npos);
99100
return false;

0 commit comments

Comments
 (0)