Reapply "[dwarfdump] Add support for dumping accelerator tables."
[oota-llvm.git] / include / llvm / DebugInfo / DIContext.h
index e99c029af30a93450fed64df4d22bbe15c7db368..3aa098d7c30b2c895c1c67eb17a0ca525c1f31ba 100644 (file)
@@ -66,21 +66,22 @@ class DIInliningInfo {
   }
 };
 
+/// A DINameKind is passed to name search methods to specify a
+/// preference regarding the type of name resolution the caller wants.
+enum class DINameKind { None, ShortName, LinkageName };
+
 /// DILineInfoSpecifier - controls which fields of DILineInfo container
 /// should be filled with data.
-class DILineInfoSpecifier {
-  const uint32_t Flags;  // Or'ed flags that set the info we want to fetch.
-public:
-  enum Specification {
-    FileLineInfo = 1 << 0,
-    AbsoluteFilePath = 1 << 1,
-    FunctionName = 1 << 2
-  };
-  // Use file/line info by default.
-  DILineInfoSpecifier(uint32_t flags = FileLineInfo) : Flags(flags) {}
-  bool needs(Specification spec) const {
-    return (Flags & spec) > 0;
-  }
+struct DILineInfoSpecifier {
+  enum class FileLineInfoKind { None, Default, AbsoluteFilePath };
+  typedef DINameKind FunctionNameKind;
+
+  FileLineInfoKind FLIKind;
+  FunctionNameKind FNKind;
+
+  DILineInfoSpecifier(FileLineInfoKind FLIKind = FileLineInfoKind::Default,
+                      FunctionNameKind FNKind = FunctionNameKind::None)
+      : FLIKind(FLIKind), FNKind(FNKind) {}
 };
 
 /// Selects which debug sections get dumped.
@@ -106,7 +107,11 @@ enum DIDumpType {
   DIDT_GnuPubtypes,
   DIDT_Str,
   DIDT_StrDwo,
-  DIDT_StrOffsetsDwo
+  DIDT_StrOffsetsDwo,
+  DIDT_AppleNames,
+  DIDT_AppleTypes,
+  DIDT_AppleNamespaces,
+  DIDT_AppleObjC
 };
 
 // In place of applying the relocations to the data we've read from disk we use
@@ -127,7 +132,7 @@ public:
   virtual ~DIContext();
 
   /// getDWARFContext - get a context for binary DWARF data.
-  static DIContext *getDWARFContext(object::ObjectFile *);
+  static DIContext *getDWARFContext(const object::ObjectFile &Obj);
 
   virtual void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All) = 0;