[llvm-commits] [llvm] r64978 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp lib/Target/IA64/IA64AsmPrinter.cpp lib/Target/Mips/MipsAsmPrinter.cpp lib/Target/PIC16/PIC16AsmPrinter.cpp lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp utils/TableGen/AsmWriterEmitter.cpp
Bill Wendling
isanbard at gmail.com
Wed Feb 18 15:12:06 PST 2009
Author: void
Date: Wed Feb 18 17:12:06 2009
New Revision: 64978
URL: http://llvm.org/viewvc/llvm-project?rev=64978&view=rev
Log:
Put code that generates debug labels into TableGen so that it can be used by
everyone.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp
llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=64978&r1=64977&r2=64978&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Wed Feb 18 17:12:06 2009
@@ -51,17 +51,17 @@
///
unsigned FunctionNumber;
- /// DW -This is needed because printDeclare() has to insert
- /// DbgVariable entries into the dwarf table. This is a short term hack
- /// that ought be fixed soon.
- DwarfWriter *DW;
-
// GCMetadataPrinters - The garbage collection metadata printer table.
typedef DenseMap<GCStrategy*,GCMetadataPrinter*> gcp_map_type;
typedef gcp_map_type::iterator gcp_iterator;
gcp_map_type GCMetadataPrinters;
protected:
+ /// DW -This is needed because printDeclare() has to insert
+ /// DbgVariable entries into the dwarf table. This is a short term hack
+ /// that ought be fixed soon.
+ DwarfWriter *DW;
+
// Necessary for external weak linkage support
std::set<const GlobalValue*> ExtWeakSymbols;
Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=64978&r1=64977&r2=64978&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Wed Feb 18 17:12:06 2009
@@ -20,6 +20,7 @@
#include "llvm/Type.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/AsmPrinter.h"
+#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/Compiler.h"
Modified: llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp?rev=64978&r1=64977&r2=64978&view=diff
==============================================================================
--- llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp Wed Feb 18 17:12:06 2009
@@ -22,6 +22,7 @@
#include "llvm/Module.h"
#include "llvm/Type.h"
#include "llvm/CodeGen/AsmPrinter.h"
+#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetMachine.h"
Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=64978&r1=64977&r2=64978&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Wed Feb 18 17:12:06 2009
@@ -23,6 +23,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/CodeGen/AsmPrinter.h"
+#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=64978&r1=64977&r2=64978&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Wed Feb 18 17:12:06 2009
@@ -14,12 +14,13 @@
#include "PIC16AsmPrinter.h"
#include "PIC16TargetAsmInfo.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/Mangler.h"
+#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/Module.h"
+#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/DerivedTypes.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Mangler.h"
using namespace llvm;
Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=64978&r1=64977&r2=64978&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Wed Feb 18 17:12:06 2009
@@ -19,6 +19,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/CodeGen/AsmPrinter.h"
+#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineInstr.h"
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=64978&r1=64977&r2=64978&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Wed Feb 18 17:12:06 2009
@@ -26,6 +26,7 @@
#include "llvm/Type.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Support/raw_ostream.h"
@@ -725,23 +726,6 @@
void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
++EmittedInsts;
- if (TAI->doesSupportDebugInformation()) {
- const Function *F = MF->getFunction();
-
- // FIXME: Support more than '-Os'.
- if (F->hasFnAttr(Attribute::OptimizeForSize)) {
- static DebugLoc PrevDL = DebugLoc::getUnknownLoc();
- DebugLoc CurDL = MI->getDebugLoc();
-
- if (!CurDL.isUnknown() && PrevDL != CurDL) {
- DebugLocTuple DLT = MF->getDebugLocTuple(CurDL);
- printLabel(DW->RecordSourceLine(DLT.Line, DLT.Col, DLT.Src));
- }
-
- PrevDL = CurDL;
- }
- }
-
// Call the autogenerated instruction printer routines.
printInstruction(MI);
}
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=64978&r1=64977&r2=64978&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Wed Feb 18 17:12:06 2009
@@ -25,6 +25,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Assembly/Writer.h"
+#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetOptions.h"
Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=64978&r1=64977&r2=64978&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Wed Feb 18 17:12:06 2009
@@ -640,6 +640,17 @@
}
O << "\";\n\n";
+ O << " {\n"
+ << " const MachineFunction *MF = MI->getParent()->getParent();\n"
+ << " static DebugLoc PrevDL = DebugLoc::getUnknownLoc();\n"
+ << " DebugLoc CurDL = MI->getDebugLoc();\n\n"
+ << " if (!CurDL.isUnknown() && PrevDL != CurDL) {\n"
+ << " DebugLocTuple DLT = MF->getDebugLocTuple(CurDL);\n"
+ << " printLabel(DW->RecordSourceLine(DLT.Line, DLT.Col, DLT.Src));\n"
+ << " }\n\n"
+ << " PrevDL = CurDL;\n"
+ << " }\n";
+
O << " if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"
<< " O << \"\\t\";\n"
<< " printInlineAsm(MI);\n"
More information about the llvm-commits
mailing list