summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm-c/lto.h10
-rw-r--r--llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h11
-rw-r--r--llvm/include/llvm/LTO/LTOModule.h31
-rw-r--r--llvm/include/llvm/Target/TargetLoweringObjectFile.h9
4 files changed, 21 insertions, 40 deletions
diff --git a/llvm/include/llvm-c/lto.h b/llvm/include/llvm-c/lto.h
index 9f37dd71e31..0ccb0e9a584 100644
--- a/llvm/include/llvm-c/lto.h
+++ b/llvm/include/llvm-c/lto.h
@@ -282,6 +282,8 @@ lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index);
/**
* Returns the number of dependent libraries in the object module.
*
+ * Deprecated. Now returns an empty list.
+ *
* \since LTO_API_VERSION=8
*/
extern unsigned int
@@ -291,6 +293,8 @@ lto_module_get_num_deplibs(lto_module_t mod);
/**
* Returns the ith dependent library in the module.
*
+ * Deprecated. Now always returns null.
+ *
* \since LTO_API_VERSION=8
*/
extern const char*
@@ -300,6 +304,9 @@ lto_module_get_deplib(lto_module_t mod, unsigned int index);
/**
* Returns the number of linker options in the object module.
*
+ * Each linker option may consist of multiple flags. It is the linker's
+ * responsibility to split the flags using a platform-specific mechanism.
+ *
* \since LTO_API_VERSION=8
*/
extern unsigned int
@@ -309,6 +316,9 @@ lto_module_get_num_linkeropts(lto_module_t mod);
/**
* Returns the ith linker option in the module.
*
+ * Each linker option may consist of multiple flags. It is the linker's
+ * responsibility to split the flags using a platform-specific mechanism.
+ *
* \since LTO_API_VERSION=8
*/
extern const char*
diff --git a/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h b/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
index 9a1b63f91bd..10c099d2c2f 100644
--- a/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
+++ b/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
@@ -90,10 +90,6 @@ public:
~TargetLoweringObjectFileMachO() override {}
TargetLoweringObjectFileMachO();
- /// Extract the dependent library name from a linker option string. Returns
- /// StringRef() if the option does not specify a library.
- StringRef getDepLibFromLinkerOpt(StringRef LinkerOption) const override;
-
/// Emit the module flags that specify the garbage collection information.
void emitModuleFlags(MCStreamer &Streamer,
ArrayRef<Module::ModuleFlagEntry> ModuleFlags,
@@ -150,10 +146,6 @@ public:
MCSection *getSectionForJumpTable(const Function &F, Mangler &Mang,
const TargetMachine &TM) const override;
- /// Extract the dependent library name from a linker option string. Returns
- /// StringRef() if the option does not specify a library.
- StringRef getDepLibFromLinkerOpt(StringRef LinkerOption) const override;
-
/// Emit Obj-C garbage collection and linker options. Only linker option
/// emission is implemented for COFF.
void emitModuleFlags(MCStreamer &Streamer,
@@ -164,6 +156,9 @@ public:
const MCSymbol *KeySym) const override;
MCSection *getStaticDtorSection(unsigned Priority,
const MCSymbol *KeySym) const override;
+
+ void emitLinkerFlagsForGlobal(raw_ostream &OS, const GlobalValue *GV,
+ const Mangler &Mang) const override;
};
} // end namespace llvm
diff --git a/llvm/include/llvm/LTO/LTOModule.h b/llvm/include/llvm/LTO/LTOModule.h
index 8204e8f3ed2..c4e2be62739 100644
--- a/llvm/include/llvm/LTO/LTOModule.h
+++ b/llvm/include/llvm/LTO/LTOModule.h
@@ -47,12 +47,11 @@ private:
std::unique_ptr<LLVMContext> OwnedContext;
+ std::string LinkerOpts;
+
std::unique_ptr<object::IRObjectFile> IRFile;
std::unique_ptr<TargetMachine> _target;
- StringSet<> _linkeropt_strings;
- std::vector<const char *> _deplibs;
- std::vector<const char *> _linkeropts;
- std::vector<NameAndAttributes> _symbols;
+ std::vector<NameAndAttributes> _symbols;
// _defines and _undefines only needed to disambiguate tentative definitions
StringSet<> _defines;
@@ -149,28 +148,8 @@ public:
return nullptr;
}
- /// Get the number of dependent libraries
- uint32_t getDependentLibraryCount() {
- return _deplibs.size();
- }
-
- /// Get the dependent library at the specified index.
- const char *getDependentLibrary(uint32_t index) {
- if (index < _deplibs.size())
- return _deplibs[index];
- return nullptr;
- }
-
- /// Get the number of linker options
- uint32_t getLinkerOptCount() {
- return _linkeropts.size();
- }
-
- /// Get the linker option at the specified index.
- const char *getLinkerOpt(uint32_t index) {
- if (index < _linkeropts.size())
- return _linkeropts[index];
- return nullptr;
+ const char *getLinkerOpts() {
+ return LinkerOpts.c_str();
}
const std::vector<const char*> &getAsmUndefinedRefs() {
diff --git a/llvm/include/llvm/Target/TargetLoweringObjectFile.h b/llvm/include/llvm/Target/TargetLoweringObjectFile.h
index 2a17bd200f4..5b626c244ba 100644
--- a/llvm/include/llvm/Target/TargetLoweringObjectFile.h
+++ b/llvm/include/llvm/Target/TargetLoweringObjectFile.h
@@ -64,12 +64,6 @@ public:
const TargetMachine &TM,
const MCSymbol *Sym) const;
- /// Extract the dependent library name from a linker option string. Returns
- /// StringRef() if the option does not specify a library.
- virtual StringRef getDepLibFromLinkerOpt(StringRef LinkerOption) const {
- return StringRef();
- }
-
/// Emit the module flags that the platform cares about.
virtual void emitModuleFlags(MCStreamer &Streamer,
ArrayRef<Module::ModuleFlagEntry> Flags,
@@ -188,6 +182,9 @@ public:
return nullptr;
}
+ virtual void emitLinkerFlagsForGlobal(raw_ostream &OS, const GlobalValue *GV,
+ const Mangler &Mang) const {}
+
protected:
virtual MCSection *SelectSectionForGlobal(const GlobalValue *GV,
SectionKind Kind, Mangler &Mang,
OpenPOWER on IntegriCloud