using llvm::SmallString;
using llvm::Twine;
using llvm::ErrorOr;
-using std::error_code;
using namespace llvm::MachO;
using namespace lld::mach_o::normalized;
// Normalized file to nf parameter.
static void fromBinary(StringRef path, std::unique_ptr<MemoryBuffer> &mb,
std::unique_ptr<NormalizedFile> &nf, StringRef archStr) {
- error_code ec = MemoryBuffer::getFile(path, mb);
+ std::error_code ec = MemoryBuffer::getFile(path, mb);
EXPECT_FALSE(ec);
ErrorOr<std::unique_ptr<NormalizedFile>> r =
f.undefinedSymbols.push_back(makeUndefSymbol("_bar"));
f.undefinedSymbols.push_back(makeUndefSymbol("_tbar"));
- error_code ec = llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
+ std::error_code ec =
+ llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
EXPECT_FALSE(ec);
ec = writeBinary(f, tmpFl);
EXPECT_FALSE(ec);
EXPECT_EQ(signed4.isExtern, true);
EXPECT_EQ(signed4.symbol, 1U);
- error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
+ std::error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
EXPECT_FALSE(ec);
}
f.undefinedSymbols.push_back(makeUndefSymbol("_bar"));
f.undefinedSymbols.push_back(makeUndefSymbol("_tbar"));
- error_code ec = llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
+ std::error_code ec =
+ llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
EXPECT_FALSE(ec);
ec = writeBinary(f, tmpFl);
EXPECT_FALSE(ec);
EXPECT_EQ(tlv.symbol, 1U);
//llvm::errs() << "temp = " << tmpFl << "\n";
- error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
+ std::error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
EXPECT_FALSE(ec);
}
f.globalSymbols.push_back(makeThumbSymbol("_foo2", 0x10));
f.undefinedSymbols.push_back(makeUndefSymbol("_bar"));
- error_code ec = llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
+ std::error_code ec =
+ llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
EXPECT_FALSE(ec);
ec = writeBinary(f, tmpFl);
EXPECT_FALSE(ec);
EXPECT_EQ(absPointer.symbol, 2U);
//llvm::errs() << "temp = " << tmpFl << "\n";
- error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
+ std::error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
EXPECT_FALSE(ec);
}
f.globalSymbols.push_back(makeSymbol("_foo2", 0x28));
f.undefinedSymbols.push_back(makeUndefSymbol("_bar"));
- error_code ec = llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
+ std::error_code ec =
+ llvm::sys::fs::createTemporaryFile(Twine("xx"), "o", tmpFl);
EXPECT_FALSE(ec);
ec = writeBinary(f, tmpFl);
EXPECT_FALSE(ec);
EXPECT_EQ(absloa2.length, 2);
EXPECT_EQ(absloa2.symbol, 0U);
- error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
+ std::error_code ec = llvm::sys::fs::remove(Twine(tmpFl));
EXPECT_FALSE(ec);
}