llvm.org GIT mirror llvm / 42e31df
fix PR9629 - We were lowering regexes like a{{b|c}}d into ab|cd, which is substantially different than a(b|c)d. Form the latter regex instead. This found a few problems in the testsuite, which serves as its test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129196 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
1 changed file(s) with 8 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
147147 return true;
148148 }
149149
150 // Enclose {{}} patterns in parens just like [[]] even though we're not
151 // capturing the result for any purpose. This is required in case the
152 // expression contains an alternation like: CHECK: abc{{x|z}}def. We
153 // want this to turn into: "abc(x|z)def" not "abcx|zdef".
154 RegExStr += '(';
155 ++CurParen;
156
150157 if (AddRegExToRegEx(PatternStr.substr(2, End-2), CurParen, SM))
151158 return true;
159 RegExStr += ')';
152160
153161 PatternStr = PatternStr.substr(End+2);
154162 continue;