search for: getbufferidentifier

Displaying 7 results from an estimated 7 matches for "getbufferidentifier".

2014 Sep 18
2
[LLVMdev] How to cache MCJIT compiled object into memory?
Hi, All I m not sure if this question has been asked or not. I'd like cache the MCJIT compiled object into memory buffer so it can be reused later. I followed the Andy Kaylor's example wrote an inherited class from ObjectCache and use raw_fd_ostream to save the cache and load the cache from a file. I checked raw_ostream and its subclass, maybe I am wrong but I don't see one is fit to
2016 Jul 07
2
ObjectCache and getFunctionAddress issue
...emoryBuffer>> CachedObjs; public: virtual void notifyObjectCompiled(const llvm::Module *M, llvm::MemoryBufferRef Obj) { auto id = M->getModuleIdentifier(); auto iter = CachedObjs.find(id); if (iter == CachedObjs.end()) { auto buf = llvm::MemoryBuffer::getMemBufferCopy(Obj.getBuffer(), Obj.getBufferIdentifier()); CachedObjs.insert(std::make_pair(id, std::move(buf))); } }; virtual std::unique_ptr<llvm::MemoryBuffer> getObject(const llvm::Module *M) { auto id = M->getModuleIdentifier(); auto iter = CachedObjs.find(id); if (iter != CachedObjs.end()) { llvm::MemoryBuffer& B = *iter->second;...
2017 Sep 05
2
[ThinLTO] static library failure with object files with the same name
...he archive made with llvm-ar does not store the full path). The library contains object files that have been compiled with `-flto=thin` (compiled with LDC, not clang, but that shouldn't matter). When linking to that static library, I get the error: Assertion failed: (ModuleMap.find(ModuleBuffer.getBufferIdentifier()) == ModuleMap.end() && "Expect unique Buffer Identifier"), function generateModuleMap, file ../lib/LTO/ThinLTOCodeGenerator.cpp, line 138. The error occurs because the buffer identifier uses the filename of the objects inside the archive, and those are identical for the two fil...
2012 May 08
0
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...I like it in general. The only comment I have is that it should match the MemoryBuffer interface where possible. static error_code getFile(...); const char *getBufferStart() const; const char *getBufferEnd() const; size_t getBufferSize() const; StringRef getBuffer() const; const char *getBufferIdentifier() const; - Michael Spencer
2012 May 08
3
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...I have is that it should match > the MemoryBuffer interface where possible. > > static error_code getFile(...); > > const char *getBufferStart() const; > const char *getBufferEnd() const; > size_t getBufferSize() const; > StringRef getBuffer() const; > const char *getBufferIdentifier() const; Except that MemoryBuffer is about reading which is "getting". OutputBuffer is about writing, so the "get" part seems wrong. That said, some of the methods could use "const". And there should be an accessor for getting the file path. If wanted to be C++11...
2012 May 08
0
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...>> the MemoryBuffer interface where possible. >> >> static error_code getFile(...); >> >> const char *getBufferStart() const; >> const char *getBufferEnd() const; >> size_t getBufferSize() const; >> StringRef getBuffer() const; >> const char *getBufferIdentifier() const; > > Except that MemoryBuffer is about reading which is "getting". OutputBuffer is about writing, so the "get" part seems wrong. That said, some of the methods could use "const". And there should be an accessor for getting the file path. If wanted t...
2012 May 07
4
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
For the reasons listed in my 03-May-2012 email, I am proposing a new llvm/Support class for using in writing binary files: /// OutputBuffer - This interface provides simple way to create an in-memory /// buffer which when done will be written to a file. During the lifetime of /// these objects, the content or existence of the specified file is undefined. /// That is, creating an OutputBuffer