summaryrefslogtreecommitdiff
path: root/include/llvm/Object/IRSymtab.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-01 13:22:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-01 13:22:02 +0000
commit9df3605dea17e84f8183581f6103bd0c79e2a606 (patch)
tree70a2f36ce9eb9bb213603cd7f2f120af53fc176f /include/llvm/Object/IRSymtab.h
parent08bbd35a80bf7765fe0d3043f9eb5a2f2786b649 (diff)
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.