Fixed debug_aranges handling for common symbols.
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.h
index 8fe60c77be518788d4c6da8db70678ac538f1ad2..e774c653945d6b621ffc4e03659a2ca86140c1d1 100644 (file)
@@ -341,6 +341,9 @@ class DwarfDebug {
   // List of all labels used in the output.
   std::vector<SymbolCU> Labels;
 
+  // Size of each symbol emitted (for those symbols that have a specific size).
+  DenseMap <const MCSymbol *, uint64_t> SymSize;
+
   // Provides a unique id per text section.
   typedef DenseMap<const MCSection *, SmallVector<SymbolCU, 8> > SectionMapType;
   SectionMapType SectionMap;
@@ -682,6 +685,10 @@ public:
   /// \brief Add a label so that arange data can be generated for it.
   void addLabel(SymbolCU SCU) { Labels.push_back(SCU); }
 
+  /// \brief For symbols that have a size designated (e.g. common symbols),
+  /// this tracks that size.
+  void setSymbolSize(const MCSymbol *Sym, uint64_t Size) { SymSize[Sym] = Size;}
+
   /// \brief Look up the source id with the given directory and source file
   /// names. If none currently exists, create a new id and insert it in the
   /// SourceIds map.