aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Option/OptTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Option/OptTable.cpp')
-rw-r--r--llvm/lib/Option/OptTable.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp
index 2b7fcf5..740e02a 100644
--- a/llvm/lib/Option/OptTable.cpp
+++ b/llvm/lib/Option/OptTable.cpp
@@ -198,8 +198,9 @@ static unsigned matchOption(const OptTable::Info *I, StringRef Str,
static bool optionMatches(const OptTable::Info &In, StringRef Option) {
if (In.Prefixes)
for (size_t I = 0; In.Prefixes[I]; I++)
- if (Option == std::string(In.Prefixes[I]) + In.Name)
- return true;
+ if (Option.endswith(In.Name))
+ if (Option == std::string(In.Prefixes[I]) + In.Name)
+ return true;
return false;
}