///
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;
#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"
#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"
#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"
#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;
#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"
#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"
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);
}
#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"
}
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"