summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-01-25 22:36:37 +0000
committerJustin Lebar <jlebar@google.com>2016-01-25 22:36:37 +0000
commitcd2f6bbd5c12972328f006a07353995b269dad44 (patch)
tree049b6aa2d20d33a789f3fce8cf5bdb4654581aa0 /clang/lib/CodeGen/CodeGenModule.cpp
parent710a35f1c7c9cdbc532fe63fc145e747049505f2 (diff)
downloadbcm5719-llvm-cd2f6bbd5c12972328f006a07353995b269dad44.tar.gz
bcm5719-llvm-cd2f6bbd5c12972328f006a07353995b269dad44.zip
[CUDA] Don't generate aliases for static extern "C" functions.
Summary: These aliases are done to support inline asm, but there's nothing we can do: NVPTX doesn't support aliases. Reviewers: tra Subscribers: cfe-commits, jhen, echristo Differential Revision: http://reviews.llvm.org/D16501 llvm-svn: 258734
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 5a85de7e234..219f95e635e 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3836,6 +3836,10 @@ static void EmitGlobalDeclMetadata(CodeGenModule &CGM,
/// to such functions with an unmangled name from inline assembly within the
/// same translation unit.
void CodeGenModule::EmitStaticExternCAliases() {
+ // Don't do anything if we're generating CUDA device code -- the NVPTX
+ // assembly target doesn't support aliases.
+ if (Context.getTargetInfo().getTriple().isNVPTX())
+ return;
for (auto &I : StaticExternCValues) {
IdentifierInfo *Name = I.first;
llvm::GlobalValue *Val = I.second;
OpenPOWER on IntegriCloud