Use Option::matches instead of direct ID comparison.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89305 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index a696f33..ce1ac3b 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -592,7 +592,7 @@
it != ie; ++it) {
Arg *A = *it;
- if (A->getOption().getId() == options::OPT_arch) {
+ if (A->getOption().matches(options::OPT_arch)) {
// Validate the option here; we don't save the type here because its
// particular spelling may participate in other driver choices.
llvm::Triple::ArchType Arch =
@@ -731,7 +731,7 @@
// necessary.
Inputs.push_back(std::make_pair(types::TY_Object, A));
- } else if (A->getOption().getId() == options::OPT_x) {
+ } else if (A->getOption().matches(options::OPT_x)) {
InputTypeArg = A;
InputType = types::lookupTypeForTypeSpecifier(A->getValue(Args));
@@ -985,7 +985,7 @@
// FIXME: Use iterator.
for (ArgList::const_iterator it = C.getArgs().begin(),
ie = C.getArgs().end(); it != ie; ++it) {
- if ((*it)->isClaimed() && (*it)->getOption().matches(Opt.getId())) {
+ if ((*it)->isClaimed() && (*it)->getOption().matches(&Opt)) {
DuplicateClaimed = true;
break;
}
diff --git a/lib/Driver/HostInfo.cpp b/lib/Driver/HostInfo.cpp
index 08c4ef4..ed73b17 100644
--- a/lib/Driver/HostInfo.cpp
+++ b/lib/Driver/HostInfo.cpp
@@ -122,7 +122,7 @@
//
// FIXME: Should this information be in llvm::Triple?
if (Arg *A = Args.getLastArg(options::OPT_m32, options::OPT_m64)) {
- if (A->getOption().getId() == options::OPT_m32) {
+ if (A->getOption().matches(options::OPT_m32)) {
if (Arch == llvm::Triple::x86_64)
Arch = llvm::Triple::x86;
if (Arch == llvm::Triple::ppc64)
@@ -205,11 +205,11 @@
if (Triple.getArch() == llvm::Triple::x86 ||
Triple.getArch() == llvm::Triple::x86_64) {
ArchName =
- (A->getOption().getId() == options::OPT_m32) ? "i386" : "x86_64";
+ (A->getOption().matches(options::OPT_m32)) ? "i386" : "x86_64";
} else if (Triple.getArch() == llvm::Triple::ppc ||
Triple.getArch() == llvm::Triple::ppc64) {
ArchName =
- (A->getOption().getId() == options::OPT_m32) ? "powerpc" : "powerpc64";
+ (A->getOption().matches(options::OPT_m32)) ? "powerpc" : "powerpc64";
}
}
@@ -478,11 +478,11 @@
if (Triple.getArch() == llvm::Triple::x86 ||
Triple.getArch() == llvm::Triple::x86_64) {
ArchName =
- (A->getOption().getId() == options::OPT_m32) ? "i386" : "x86_64";
+ (A->getOption().matches(options::OPT_m32)) ? "i386" : "x86_64";
} else if (Triple.getArch() == llvm::Triple::ppc ||
Triple.getArch() == llvm::Triple::ppc64) {
ArchName =
- (A->getOption().getId() == options::OPT_m32) ? "powerpc" : "powerpc64";
+ (A->getOption().matches(options::OPT_m32)) ? "powerpc" : "powerpc64";
}
}
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index e0af3bc..d42751b 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -81,8 +81,8 @@
DepFile = Output.getFilename();
} else if (Arg *MF = Args.getLastArg(options::OPT_MF)) {
DepFile = MF->getValue(Args);
- } else if (A->getOption().getId() == options::OPT_M ||
- A->getOption().getId() == options::OPT_MM) {
+ } else if (A->getOption().matches(options::OPT_M) ||
+ A->getOption().matches(options::OPT_MM)) {
DepFile = "-";
} else {
DepFile = darwin::CC1::getDependencyFileName(Args, Inputs);
@@ -116,8 +116,8 @@
CmdArgs.push_back(DepTarget);
}
- if (A->getOption().getId() == options::OPT_M ||
- A->getOption().getId() == options::OPT_MD)
+ if (A->getOption().matches(options::OPT_M) ||
+ A->getOption().matches(options::OPT_MD))
CmdArgs.push_back("-sys-header-deps");
}
@@ -822,7 +822,7 @@
// Manually translate -O to -O2 and -O4 to -O3; let clang reject
// others.
if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {
- if (A->getOption().getId() == options::OPT_O4)
+ if (A->getOption().matches(options::OPT_O4))
CmdArgs.push_back("-O3");
else if (A->getValue(Args)[0] == '\0')
CmdArgs.push_back("-O2");