diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 21:25:48 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 21:25:48 +0000 |
| commit | d88c1a5a572cdb661c111098831fa526e933756f (patch) | |
| tree | 97b32c3372106ac47ded3d1a99f9c023a8530073 /contrib/llvm/lib/IR/Module.cpp | |
| parent | 715652a404ee99f10c09c0a5edbb5883961b8c25 (diff) | |
| parent | b915e9e0fc85ba6f398b3fab0db6a81a8913af94 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/lib/IR/Module.cpp')
| -rw-r--r-- | contrib/llvm/lib/IR/Module.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/contrib/llvm/lib/IR/Module.cpp b/contrib/llvm/lib/IR/Module.cpp index ae81b25b9517..1911f84340c6 100644 --- a/contrib/llvm/lib/IR/Module.cpp +++ b/contrib/llvm/lib/IR/Module.cpp @@ -25,6 +25,8 @@ #include "llvm/IR/LLVMContext.h" #include "llvm/IR/TypeFinder.h" #include "llvm/Support/Dwarf.h" +#include "llvm/Support/Error.h" +#include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" #include "llvm/Support/RandomNumberGenerator.h" #include <algorithm> @@ -404,23 +406,23 @@ void Module::setMaterializer(GVMaterializer *GVM) { Materializer.reset(GVM); } -std::error_code Module::materialize(GlobalValue *GV) { +Error Module::materialize(GlobalValue *GV) { if (!Materializer) - return std::error_code(); + return Error::success(); return Materializer->materialize(GV); } -std::error_code Module::materializeAll() { +Error Module::materializeAll() { if (!Materializer) - return std::error_code(); + return Error::success(); std::unique_ptr<GVMaterializer> M = std::move(Materializer); return M->materializeModule(); } -std::error_code Module::materializeMetadata() { +Error Module::materializeMetadata() { if (!Materializer) - return std::error_code(); + return Error::success(); return Materializer->materializeMetadata(); } @@ -519,6 +521,10 @@ Metadata *Module::getProfileSummary() { return getModuleFlag("ProfileSummary"); } +void Module::setOwnedMemoryBuffer(std::unique_ptr<MemoryBuffer> MB) { + OwnedMemoryBuffer = std::move(MB); +} + GlobalVariable *llvm::collectUsedGlobalVariables( const Module &M, SmallPtrSetImpl<GlobalValue *> &Set, bool CompilerUsed) { const char *Name = CompilerUsed ? "llvm.compiler.used" : "llvm.used"; |
