diff options
author | Zachary Turner <zturner@google.com> | 2017-09-18 23:14:15 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-09-18 23:14:15 +0000 |
commit | 814f69e3692fe436c502c75524aa52dd727b33c1 (patch) | |
tree | 348c3d2d5ca18d4d3d9cd07102f4f8cd0252152e /utils/lit | |
parent | 96d302642092aeb6e021a68e5287b2f6242024f6 (diff) |
Fix inverted regex search.
I was using the pattern as the source string and vice versa
causing strange regular expression errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit')
-rw-r--r-- | utils/lit/lit/llvm/config.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/lit/lit/llvm/config.py b/utils/lit/lit/llvm/config.py index 175aa699327..cd1f8eea750 100644 --- a/utils/lit/lit/llvm/config.py +++ b/utils/lit/lit/llvm/config.py @@ -148,14 +148,14 @@ class LLVMConfig(object): output, _ = llvm_config_cmd.communicate() output = output.decode(encoding) lines = output.split('\n') - for (line, (_, patterns)) in zip(lines, features): + for (feature_line, (_, patterns)) in zip(lines, features): # We should have either a callable or a dictionary. If it's a # dictionary, grep each key against the output and use the value if # it matches. If it's a callable, it does the entire translation. if callable(patterns): - features_to_add = patterns(line) + features_to_add = patterns(feature_line) self.config.available_features.update(features_to_add) else: - for (match, feature) in patterns.items(): - if re.search(line, match): + for (re_pattern, feature) in patterns.items(): + if re.search(re_pattern, feature_line): self.config.available_features.add(feature) |