Skip to content

Commit 4458696

Browse files
committed
Make clang report invalid target versions for all environment.
Followup for llvm#75373 1. Make this feature not just available for android, but everyone. 2. Correct some target triples. 3. Add opencl to the environment type list.
1 parent 3d25a65 commit 4458696

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/TargetParser/Triple.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,9 +1236,8 @@ StringRef Triple::getEnvironmentVersionString() const {
12361236
if (getObjectFormat() != Triple::UnknownObjectFormat) {
12371237
StringRef ObjectFormatTypeName =
12381238
getObjectFormatTypeName(getObjectFormat());
1239-
const std::string &tmp = (Twine("-") + ObjectFormatTypeName).str();
1240-
StringRef Suffix = tmp;
1241-
EnvironmentName.consume_back(Suffix);
1239+
const std::string tmp = (Twine("-") + ObjectFormatTypeName).str();
1240+
EnvironmentName.consume_back(tmp);
12421241
}
12431242
}
12441243
return EnvironmentName;

0 commit comments

Comments
 (0)