Skip to content

Commit 2d8120b

Browse files
committed
[Clang][AArch64] Simplify getAArch64MicroArchFeatures*
1 parent 10e9d8f commit 2d8120b

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

clang/lib/Driver/ToolChains/Arch/AArch64.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,28 +156,18 @@ static bool
156156
getAArch64MicroArchFeaturesFromMtune(const Driver &D, StringRef Mtune,
157157
const ArgList &Args,
158158
std::vector<StringRef> &Features) {
159-
std::string MtuneLowerCase = Mtune.lower();
160159
// Check CPU name is valid, but ignore any extensions on it.
160+
std::string MtuneLowerCase = Mtune.lower();
161161
llvm::AArch64::ExtensionSet Extensions;
162162
StringRef Tune;
163-
if (!DecodeAArch64Mcpu(D, MtuneLowerCase, Tune, Extensions))
164-
return false;
165-
166-
return true;
163+
return DecodeAArch64Mcpu(D, MtuneLowerCase, Tune, Extensions);
167164
}
168165

169166
static bool
170167
getAArch64MicroArchFeaturesFromMcpu(const Driver &D, StringRef Mcpu,
171168
const ArgList &Args,
172169
std::vector<StringRef> &Features) {
173-
StringRef CPU;
174-
// Check CPU name is valid, but ignore any extensions on it.
175-
llvm::AArch64::ExtensionSet DecodedFeature;
176-
std::string McpuLowerCase = Mcpu.lower();
177-
if (!DecodeAArch64Mcpu(D, McpuLowerCase, CPU, DecodedFeature))
178-
return false;
179-
180-
return getAArch64MicroArchFeaturesFromMtune(D, CPU, Args, Features);
170+
return getAArch64MicroArchFeaturesFromMtune(D, Mcpu, Args, Features);
181171
}
182172

183173
void aarch64::getAArch64TargetFeatures(const Driver &D,

0 commit comments

Comments
 (0)