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 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
1818using 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 ;
You can’t perform that action at this time.
0 commit comments