summaryrefslogtreecommitdiff
path: root/lib/LTO
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-13 02:24:39 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-13 02:24:39 +0000
commit4e2b922131ae617cb8738d1871e9d918c44bdb69 (patch)
treed7ce433d5ae4fb27277c6d3777ca12199ffd51ac /lib/LTO
parente431884ed751a78941cb32835d82dda24c839a1e (diff)
downloadllvm-4e2b922131ae617cb8738d1871e9d918c44bdb69.tar.gz
llvm-4e2b922131ae617cb8738d1871e9d918c44bdb69.tar.bz2
llvm-4e2b922131ae617cb8738d1871e9d918c44bdb69.tar.xz
Remove 'using std::errro_code' from lib.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/LTO')
-rw-r--r--lib/LTO/LTOCodeGenerator.cpp6
-rw-r--r--lib/LTO/LTOModule.cpp7
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp
index c263f8f477..9009958613 100644
--- a/lib/LTO/LTOCodeGenerator.cpp
+++ b/lib/LTO/LTOCodeGenerator.cpp
@@ -53,7 +53,6 @@
#include "llvm/Transforms/ObjCARC.h"
#include <system_error>
using namespace llvm;
-using std::error_code;
const char* LTOCodeGenerator::getVersionString() {
#ifdef LLVM_VERSION_INFO
@@ -209,7 +208,8 @@ bool LTOCodeGenerator::compile_to_file(const char** name,
// make unique temp .o file to put generated object file
SmallString<128> Filename;
int FD;
- error_code EC = sys::fs::createTemporaryFile("lto-llvm", "o", FD, Filename);
+ std::error_code EC =
+ sys::fs::createTemporaryFile("lto-llvm", "o", FD, Filename);
if (EC) {
errMsg = EC.message();
return false;
@@ -253,7 +253,7 @@ const void* LTOCodeGenerator::compile(size_t* length,
// read .o file into memory buffer
std::unique_ptr<MemoryBuffer> BuffPtr;
- if (error_code ec = MemoryBuffer::getFile(name, BuffPtr, -1, false)) {
+ if (std::error_code ec = MemoryBuffer::getFile(name, BuffPtr, -1, false)) {
errMsg = ec.message();
sys::fs::remove(NativeObjectPath);
return nullptr;
diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp
index aee0ef8cdc..eac48e16e8 100644
--- a/lib/LTO/LTOModule.cpp
+++ b/lib/LTO/LTOModule.cpp
@@ -43,7 +43,6 @@
#include "llvm/Transforms/Utils/GlobalStatus.h"
#include <system_error>
using namespace llvm;
-using std::error_code;
LTOModule::LTOModule(llvm::Module *m, llvm::TargetMachine *t)
: _module(m), _target(t),
@@ -99,7 +98,7 @@ bool LTOModule::isTargetMatch(MemoryBuffer *buffer, const char *triplePrefix) {
LTOModule *LTOModule::makeLTOModule(const char *path, TargetOptions options,
std::string &errMsg) {
std::unique_ptr<MemoryBuffer> buffer;
- if (error_code ec = MemoryBuffer::getFile(path, buffer)) {
+ if (std::error_code ec = MemoryBuffer::getFile(path, buffer)) {
errMsg = ec.message();
return nullptr;
}
@@ -118,7 +117,7 @@ LTOModule *LTOModule::makeLTOModule(int fd, const char *path,
TargetOptions options,
std::string &errMsg) {
std::unique_ptr<MemoryBuffer> buffer;
- if (error_code ec =
+ if (std::error_code ec =
MemoryBuffer::getOpenFileSlice(fd, path, buffer, map_size, offset)) {
errMsg = ec.message();
return nullptr;
@@ -141,7 +140,7 @@ LTOModule *LTOModule::makeLTOModule(MemoryBuffer *buffer,
// parse bitcode buffer
ErrorOr<Module *> ModuleOrErr =
getLazyBitcodeModule(buffer, getGlobalContext());
- if (error_code EC = ModuleOrErr.getError()) {
+ if (std::error_code EC = ModuleOrErr.getError()) {
errMsg = EC.message();
delete buffer;
return nullptr;