summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-06 00:58:50 +0000
committerChris Lattner <sabre@nondot.org>2010-04-06 00:58:50 +0000
commit92aba5a81714f0e7415d38478a70a33fa75dec80 (patch)
treeaff7d24bc82590ddb6c993cc50fe773044bf9df2 /llvm/lib/CodeGen
parent59126b2500b81c78768ce132eb43b0af8f6e3bfd (diff)
downloadbcm5719-llvm-92aba5a81714f0e7415d38478a70a33fa75dec80.tar.gz
bcm5719-llvm-92aba5a81714f0e7415d38478a70a33fa75dec80.zip
propagate cookie management out one layer of function calls.
llvm-svn: 100510
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp2
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp7
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 425e662e293..c86e2411d30 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -144,7 +144,7 @@ bool AsmPrinter::doInitialization(Module &M) {
if (!M.getModuleInlineAsm().empty()) {
OutStreamer.AddComment("Start of file scope inline assembly");
OutStreamer.AddBlankLine();
- EmitInlineAsm(M.getModuleInlineAsm());
+ EmitInlineAsm(M.getModuleInlineAsm(), 0/*no loc cookie*/);
OutStreamer.AddComment("End of file scope inline assembly");
OutStreamer.AddBlankLine();
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
index a4d46c36f3b..255bcd413f2 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
@@ -35,7 +35,7 @@
using namespace llvm;
/// EmitInlineAsm - Emit a blob of inline asm to the output streamer.
-void AsmPrinter::EmitInlineAsm(StringRef Str) const {
+void AsmPrinter::EmitInlineAsm(StringRef Str, unsigned LocCookie) const {
assert(!Str.empty() && "Can't emit empty inline asm block");
// Remember if the buffer is nul terminated or not so we can avoid a copy.
@@ -57,9 +57,8 @@ void AsmPrinter::EmitInlineAsm(StringRef Str) const {
LLVMContext &LLVMCtx = MMI->getModule()->getContext();
bool HasDiagHandler = false;
if (void *DiagHandler = LLVMCtx.getInlineAsmDiagnosticHandler()) {
- unsigned Cookie = 0; // no cookie yet.
SrcMgr.setDiagHandler((SourceMgr::DiagHandlerTy)(intptr_t)DiagHandler,
- LLVMCtx.getInlineAsmDiagnosticContext(), Cookie);
+ LLVMCtx.getInlineAsmDiagnosticContext(), LocCookie);
HasDiagHandler = true;
}
@@ -297,7 +296,7 @@ void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const {
}
}
OS << '\n' << (char)0; // null terminate string.
- EmitInlineAsm(OS.str());
+ EmitInlineAsm(OS.str(), 0/*no loc cookie*/);
// Emit the #NOAPP end marker. This has to happen even if verbose-asm isn't
// enabled, so we use EmitRawText.
OpenPOWER on IntegriCloud