summaryrefslogtreecommitdiff
path: root/include/llvm/Object
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
parent08bbd35a80bf7765fe0d3043f9eb5a2f2786b649 (diff)
Diffstat (limited to 'include/llvm/Object')
-rw-r--r--include/llvm/Object/Archive.h2
-rw-r--r--include/llvm/Object/COFF.h2
-rw-r--r--include/llvm/Object/COFFImportFile.h2
-rw-r--r--include/llvm/Object/ELFObjectFile.h4
-rw-r--r--include/llvm/Object/IRObjectFile.h2
-rw-r--r--include/llvm/Object/IRSymtab.h14
-rw-r--r--include/llvm/Object/MachOUniversal.h2
-rw-r--r--include/llvm/Object/ObjectFile.h2
-rw-r--r--include/llvm/Object/SymbolicFile.h2
-rw-r--r--include/llvm/Object/Wasm.h3
10 files changed, 26 insertions, 9 deletions
diff --git a/include/llvm/Object/Archive.h b/include/llvm/Object/Archive.h
index 6c5fb9d5c92b..e56e8e464de3 100644
--- a/include/llvm/Object/Archive.h
+++ b/include/llvm/Object/Archive.h
@@ -253,7 +253,7 @@ public:
}
// Cast methods.
- static inline bool classof(Binary const *v) {
+ static bool classof(Binary const *v) {
return v->isArchive();
}
diff --git a/include/llvm/Object/COFF.h b/include/llvm/Object/COFF.h
index bf0172822d3f..78e0b5f6ed30 100644
--- a/include/llvm/Object/COFF.h
+++ b/include/llvm/Object/COFF.h
@@ -1026,7 +1026,7 @@ public:
bool isRelocatableObject() const override;
bool is64() const { return PE32PlusHeader; }
- static inline bool classof(const Binary *v) { return v->isCOFF(); }
+ static bool classof(const Binary *v) { return v->isCOFF(); }
};
// The iterator for the import directory table.
diff --git a/include/llvm/Object/COFFImportFile.h b/include/llvm/Object/COFFImportFile.h
index 78044a2832fa..060f965233e1 100644
--- a/include/llvm/Object/COFFImportFile.h
+++ b/include/llvm/Object/COFFImportFile.h
@@ -33,7 +33,7 @@ public:
COFFImportFile(MemoryBufferRef Source)
: SymbolicFile(ID_COFFImportFile, Source) {}
- static inline bool classof(Binary const *V) { return V->isCOFFImportFile(); }
+ static bool classof(Binary const *V) { return V->isCOFFImportFile(); }
void moveSymbolNext(DataRefImpl &Symb) const override { ++Symb.p; }
diff --git a/include/llvm/Object/ELFObjectFile.h b/include/llvm/Object/ELFObjectFile.h
index 2ba3b13f49da..73011f6f9fe1 100644
--- a/include/llvm/Object/ELFObjectFile.h
+++ b/include/llvm/Object/ELFObjectFile.h
@@ -70,7 +70,7 @@ public:
elf_symbol_iterator_range symbols() const;
- static inline bool classof(const Binary *v) { return v->isELF(); }
+ static bool classof(const Binary *v) { return v->isELF(); }
SubtargetFeatures getFeatures() const override;
@@ -389,7 +389,7 @@ public:
const ELFFile<ELFT> *getELFFile() const { return &EF; }
bool isDyldType() const { return isDyldELFObject; }
- static inline bool classof(const Binary *v) {
+ static bool classof(const Binary *v) {
return v->getType() == getELFType(ELFT::TargetEndianness == support::little,
ELFT::Is64Bits);
}
diff --git a/include/llvm/Object/IRObjectFile.h b/include/llvm/Object/IRObjectFile.h
index 3bce7813ee93..9a696bffd1f0 100644
--- a/include/llvm/Object/IRObjectFile.h
+++ b/include/llvm/Object/IRObjectFile.h
@@ -46,7 +46,7 @@ public:
StringRef getTargetTriple() const;
- static inline bool classof(const Binary *v) {
+ static bool classof(const Binary *v) {
return v->isIR();
}
diff --git a/include/llvm/Object/IRSymtab.h b/include/llvm/Object/IRSymtab.h
index 502f133d307d..824a67a672fa 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.
diff --git a/include/llvm/Object/MachOUniversal.h b/include/llvm/Object/MachOUniversal.h
index 8a6f0fc56971..72837d0970c4 100644
--- a/include/llvm/Object/MachOUniversal.h
+++ b/include/llvm/Object/MachOUniversal.h
@@ -154,7 +154,7 @@ public:
uint32_t getNumberOfObjects() const { return NumberOfObjects; }
// Cast methods.
- static inline bool classof(Binary const *V) {
+ static bool classof(Binary const *V) {
return V->isMachOUniversalBinary();
}
diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h
index 6b5b9d95fcf3..afcad3090703 100644
--- a/include/llvm/Object/ObjectFile.h
+++ b/include/llvm/Object/ObjectFile.h
@@ -313,7 +313,7 @@ public:
return createObjectFile(Object, llvm::file_magic::unknown);
}
- static inline bool classof(const Binary *v) {
+ static bool classof(const Binary *v) {
return v->isObject();
}
diff --git a/include/llvm/Object/SymbolicFile.h b/include/llvm/Object/SymbolicFile.h
index 97eeba6611a2..5b9549bc3449 100644
--- a/include/llvm/Object/SymbolicFile.h
+++ b/include/llvm/Object/SymbolicFile.h
@@ -173,7 +173,7 @@ public:
static Expected<OwningBinary<SymbolicFile>>
createSymbolicFile(StringRef ObjectPath);
- static inline bool classof(const Binary *v) {
+ static bool classof(const Binary *v) {
return v->isSymbolic();
}
};
diff --git a/include/llvm/Object/Wasm.h b/include/llvm/Object/Wasm.h
index 9d53131234f4..5c8445f10f44 100644
--- a/include/llvm/Object/Wasm.h
+++ b/include/llvm/Object/Wasm.h
@@ -100,6 +100,7 @@ public:
const std::vector<wasm::WasmLimits>& memories() const { return Memories; }
const std::vector<wasm::WasmGlobal>& globals() const { return Globals; }
const std::vector<wasm::WasmExport>& exports() const { return Exports; }
+ const wasm::WasmLinkingData& linkingData() const { return LinkingData; }
uint32_t getNumberOfSymbols() const {
return Symbols.size();
@@ -214,6 +215,8 @@ private:
std::vector<WasmSymbol> Symbols;
ArrayRef<uint8_t> CodeSection;
uint32_t StartFunction = -1;
+ bool HasLinkingSection = false;
+ wasm::WasmLinkingData LinkingData;
StringMap<uint32_t> SymbolMap;
};