summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-04-29 23:05:19 +0000
committerJustin Lebar <jlebar@google.com>2016-04-29 23:05:19 +0000
commit76945b2f440dd798a814a8e485b42ab9671656ea (patch)
tree4ebae7b527b49e701e2dd29f2bb73af101ead024 /clang/lib/Frontend/CompilerInstance.cpp
parent4b2fdccad95e47f764424e35f63d0df58f3ae86a (diff)
downloadbcm5719-llvm-76945b2f440dd798a814a8e485b42ab9671656ea.tar.gz
bcm5719-llvm-76945b2f440dd798a814a8e485b42ab9671656ea.zip
[CUDA] Copy host builtin types to NVPTXTargetInfo.
Summary: Host and device types must match, otherwise when we pass values back and forth between the host and device, we will get the wrong result. This patch makes NVPTXTargetInfo inherit most of its type information from the host's target info. Reviewers: rsmith Subscribers: cfe-commits, jhen, tra Differential Revision: http://reviews.llvm.org/D19346 llvm-svn: 268131
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index cac73befff0..d6f4749db24 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -836,8 +836,9 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
// Create TargetInfo for the other side of CUDA compilation.
if (getLangOpts().CUDA && !getFrontendOpts().AuxTriple.empty()) {
- std::shared_ptr<TargetOptions> TO(new TargetOptions);
+ auto TO = std::make_shared<TargetOptions>();
TO->Triple = getFrontendOpts().AuxTriple;
+ TO->HostTriple = getTarget().getTriple().str();
setAuxTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), TO));
}
OpenPOWER on IntegriCloud