summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2018-08-08 22:23:57 +0000
committerPetr Hosek <phosek@chromium.org>2018-08-08 22:23:57 +0000
commit2db0cb23ff81bc2cef0850287ab6fe1ceacf003b (patch)
tree8c3c313014a3a2b001b62a5e920410c30e8fdc64 /lib/Frontend/CompilerInstance.cpp
parent10e00557b9354c77801f822cd675785318247031 (diff)
downloadclang-2db0cb23ff81bc2cef0850287ab6fe1ceacf003b.tar.gz
[ADT] Normalize empty triple components
LLVM triple normalization is handling "unknown" and empty components differently; for example given "x86_64-unknown-linux-gnu" and "x86_64-linux-gnu" which should be equivalent, triple normalization returns "x86_64-unknown-linux-gnu" and "x86_64--linux-gnu". autoconf's config.sub returns "x86_64-unknown-linux-gnu" for both "x86_64-linux-gnu" and "x86_64-unknown-linux-gnu". This changes the triple normalization to behave the same way, replacing empty triple components with "unknown". This addresses PR37129. Differential Revision: https://reviews.llvm.org/D50219 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index ecb09da3c1..f1a8720045 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -921,7 +921,7 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
if ((getLangOpts().CUDA || getLangOpts().OpenMPIsDevice) &&
!getFrontendOpts().AuxTriple.empty()) {
auto TO = std::make_shared<TargetOptions>();
- TO->Triple = getFrontendOpts().AuxTriple;
+ TO->Triple = llvm::Triple::normalize(getFrontendOpts().AuxTriple);
TO->HostTriple = getTarget().getTriple().str();
setAuxTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), TO));
}