propagate cookie management out one layer of function calls.
authorChris Lattner <sabre@nondot.org>
Tue, 6 Apr 2010 00:58:50 +0000 (00:58 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 6 Apr 2010 00:58:50 +0000 (00:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100510 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp

index 03dc67f47d075d786039064927ab1e1550fd83f8..2eff50123a23b3de39204311e93653da5bea6065 100644 (file)
@@ -423,7 +423,7 @@ namespace llvm {
     mutable unsigned SetCounter;
 
     /// EmitInlineAsm - Emit a blob of inline asm to the output streamer.
-    void EmitInlineAsm(StringRef Str) const;
+    void EmitInlineAsm(StringRef Str, unsigned LocCookie) const;
     
     /// EmitInlineAsm - This method formats and emits the specified machine
     /// instruction that is an inline asm.
index 425e662e2932a0b4ac3f3182da45c62e893a47a0..c86e2411d303b537a1196a0769840b1825aa4dae 100644 (file)
@@ -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();
   }
index a4d46c36f3b9fbe3d0f1fc3f9c1e9390927ae8ab..255bcd413f225384290dbe5fde3417515999ae81 100644 (file)
@@ -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.