Skip to content

Commit 1f35113

Browse files
tangaacSixWeining
andcommitted
Update clang/lib/Driver/ToolChains/Arch/LoongArch.cpp
Co-authored-by: Lu Weining <[email protected]>
1 parent 206bfe8 commit 1f35113

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "clang/Driver/Options.h"
1515
#include "llvm/TargetParser/Host.h"
1616
#include "llvm/TargetParser/LoongArchTargetParser.h"
17-
#include <string>
1817

1918
using namespace clang::driver;
2019
using namespace clang::driver::tools;
@@ -141,7 +140,7 @@ void loongarch::getLoongArchTargetFeatures(const Driver &D,
141140
ArchName = MArch->getValue();
142141
ArchName = postProcessTargetCPUString(ArchName, Triple);
143142
llvm::LoongArch::getArchFeatures(ArchName, Features);
144-
if ((std::string)(MArch->getValue()) == "native")
143+
if (MArch && StringRef(MArch->getValue()) == "native")
145144
for (auto &F : llvm::sys::getHostCPUFeatures())
146145
Features.push_back(
147146
Args.MakeArgString((F.second ? "+" : "-") + F.first()));

0 commit comments

Comments
 (0)