summaryrefslogtreecommitdiff
path: root/include/llvm/Object/IRSymtab.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Object/IRSymtab.h')
-rw-r--r--include/llvm/Object/IRSymtab.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Object/IRSymtab.h b/include/llvm/Object/IRSymtab.h
index 502f133d307dd..824a67a672faf 100644
--- a/include/llvm/Object/IRSymtab.h
+++ b/include/llvm/Object/IRSymtab.h
@@ -124,6 +124,18 @@ struct Uncommon {
};
struct Header {
+ /// Version number of the symtab format. This number should be incremented
+ /// when the format changes, but it does not need to be incremented if a
+ /// change to LLVM would cause it to create a different symbol table.
+ Word Version;
+ enum { kCurrentVersion = 0 };
+
+ /// The producer's version string (LLVM_VERSION_STRING " " LLVM_REVISION).
+ /// Consumers should rebuild the symbol table from IR if the producer's
+ /// version does not match the consumer's version due to potential differences
+ /// in symbol table format, symbol enumeration order and so on.
+ Str Producer;
+
Range<Module> Modules;
Range<Comdat> Comdats;
Range<Symbol> Symbols;
@@ -243,6 +255,8 @@ public:
/// copied into an irsymtab::Symbol object.
symbol_range symbols() const;
+ size_t getNumModules() const { return Modules.size(); }
+
/// Returns a slice of the symbol table for the I'th module in the file.
/// The symbols enumerated by this method are ephemeral, but they can be
/// copied into an irsymtab::Symbol object.