[PATCH] D12917: [CUDA] Allow parsing of host and device code simultaneously.
Eric Christopher via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 17 12:59:59 PDT 2015
echristo added a comment.
One inline request and one inline comment, otherwise looks pretty good!
Thanks :)
-eric
================
Comment at: include/clang/Frontend/CompilerInstance.h:355
@@ -350,3 +354,3 @@
- /// Replace the current diagnostics engine.
+ /// Replace the current Target.
void setTarget(TargetInfo *Value);
----------------
Go ahead and just commit this separately please. :)
================
Comment at: lib/Frontend/CompilerInstance.cpp:84-89
@@ -83,1 +83,8 @@
+
+ // Create TargetInfo for the other side of CUDA compilation.
+ if (getLangOpts().CUDA && !getFrontendOpts().AuxTriple.empty()) {
+ std::shared_ptr<TargetOptions> TO(new TargetOptions);
+ TO->Triple = getFrontendOpts().AuxTriple;
+ AuxTarget = TargetInfo::CreateTargetInfo(getDiagnostics(), TO);
+ }
}
----------------
Seems like an icky place to do this, perhaps where we create the Target?
http://reviews.llvm.org/D12917
More information about the cfe-commits
mailing list