File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
llvm/lib/Transforms/Vectorize/SandboxVectorizer Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11
11
#include " llvm/IR/Module.h"
12
12
#include " llvm/SandboxIR/Constant.h"
13
13
#include " llvm/Support/CommandLine.h"
14
+ #include " llvm/Support/Regex.h"
14
15
#include " llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h"
15
16
#include " llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.h"
16
- #include < regex>
17
17
18
18
using namespace llvm ;
19
19
@@ -92,8 +92,9 @@ bool SandboxVectorizerPass::allowFile(const std::string &SrcFilePath) {
92
92
if (FileNameToMatch.empty ())
93
93
return false ;
94
94
// 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))
97
98
return true ;
98
99
} while (DelimPos != std::string::npos);
99
100
return false ;
You can’t perform that action at this time.
0 commit comments