aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorJustin Holewinski <jholewinski@nvidia.com>2013-07-01 13:00:14 +0000
committerJustin Holewinski <jholewinski@nvidia.com>2013-07-01 13:00:14 +0000
commit728af3d574895dd9e4bb5c418c7398297c4f39fe (patch)
treee28b8c8ed46fa212965fcc3f01dd6b906dd002d3 /lib/Target
parent1fd09172bba8539e198db0360ac66f4694b4a3e0 (diff)
downloadexternal_llvm-728af3d574895dd9e4bb5c418c7398297c4f39fe.zip
external_llvm-728af3d574895dd9e4bb5c418c7398297c4f39fe.tar.gz
external_llvm-728af3d574895dd9e4bb5c418c7398297c4f39fe.tar.bz2
[NVPTX] Add support for module-scope inline asm
Since we were explicitly not calling AsmPrinter::doInitialization, any module-scope inline asm was not being printed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/NVPTX/NVPTXAsmPrinter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
index 9662f4c..93ba8d5 100644
--- a/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+++ b/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
@@ -1043,6 +1043,16 @@ bool NVPTXAsmPrinter::doInitialization(Module &M) {
// Already commented out
//bool Result = AsmPrinter::doInitialization(M);
+ // Emit module-level inline asm if it exists.
+ if (!M.getModuleInlineAsm().empty()) {
+ OutStreamer.AddComment("Start of file scope inline assembly");
+ OutStreamer.AddBlankLine();
+ OutStreamer.EmitRawText(StringRef(M.getModuleInlineAsm()));
+ OutStreamer.AddBlankLine();
+ OutStreamer.AddComment("End of file scope inline assembly");
+ OutStreamer.AddBlankLine();
+ }
+
if (nvptxSubtarget.getDrvInterface() == NVPTX::CUDA)
recordAndEmitFilenames(M);