From f3fc8c9d0953dbb275f00122afbe207ef7e76df4 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Mon, 10 Feb 2014 23:26:14 +0000 Subject: LTO API: add lto_module_create_from_memory_with_path. This function adds an extra path argument to lto_module_create_from_memory. The path argument will be passed to makeBuffer to make sure the MemoryBuffer has a name and the created module has a module identifier. This is mainly for emitting warning messages from the linker. When we emit warning message on a module, we can use the module identifier. rdar://15985737 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201114 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/LTO/LTOModule.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/llvm') diff --git a/include/llvm/LTO/LTOModule.h b/include/llvm/LTO/LTOModule.h index c70afa4196..a70b71fa2e 100644 --- a/include/llvm/LTO/LTOModule.h +++ b/include/llvm/LTO/LTOModule.h @@ -100,7 +100,8 @@ public: std::string& errMsg); static LTOModule *makeLTOModule(const void *mem, size_t length, llvm::TargetOptions options, - std::string &errMsg); + std::string &errMsg, + llvm::StringRef path = ""); /// getTargetTriple - Return the Module's target triple. const char *getTargetTriple() { @@ -222,8 +223,9 @@ private: llvm::TargetOptions options, std::string &errMsg); - /// makeBuffer - Create a MemoryBuffer from a memory range. - static llvm::MemoryBuffer *makeBuffer(const void *mem, size_t length); + /// Create a MemoryBuffer from a memory range with an optional name. + static llvm::MemoryBuffer *makeBuffer(const void *mem, size_t length, + llvm::StringRef name = ""); }; #endif // LTO_MODULE_H -- cgit v1.2.3