DebugInfo: Improve reuse of file table entries in asm debug info
[oota-llvm.git] / include / llvm / MC / MCDwarf.h
index abd2f7a2d6919a16dab1933f4bee6157e97e58d6..3b6045061443f99545ee9fe9fd85ee7573478e68 100644 (file)
@@ -16,6 +16,7 @@
 #define LLVM_MC_MCDWARF_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/MapVector.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Dwarf.h"
@@ -179,8 +180,9 @@ struct MCDwarfLineTableHeader {
   MCSymbol *Label;
   SmallVector<std::string, 3> MCDwarfDirs;
   SmallVector<MCDwarfFile, 3> MCDwarfFiles;
+  StringMap<unsigned> SourceIdMap;
   MCDwarfLineTableHeader() : Label(nullptr) {}
-  unsigned getFile(StringRef Directory, StringRef FileName, unsigned FileNumber);
+  unsigned getFile(StringRef Directory, StringRef FileName, unsigned FileNumber = 0);
   std::pair<MCSymbol *, MCSymbol *> Emit(MCStreamer *MCOS) const;
 };
 
@@ -195,7 +197,7 @@ public:
   // This emits the Dwarf file and the line tables for a given Compile Unit.
   const MCSymbol *EmitCU(MCStreamer *MCOS) const;
 
-  unsigned getFile(StringRef Directory, StringRef FileName, unsigned FileNumber);
+  unsigned getFile(StringRef Directory, StringRef FileName, unsigned FileNumber = 0);
 
   MCSymbol *getLabel() const {
     return Header.Label;