[lld] r210820 - Refer to error_code with an std prefix.
Rafael Espindola
rafael.espindola at gmail.com
Thu Jun 12 13:42:13 PDT 2014
Author: rafael
Date: Thu Jun 12 15:42:12 2014
New Revision: 210820
URL: http://llvm.org/viewvc/llvm-project?rev=210820&view=rev
Log:
Refer to error_code with an std prefix.
Modified:
lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
lld/trunk/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp
lld/trunk/utils/linker-script-test/linker-script-test.cpp
Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp?rev=210820&r1=210819&r2=210820&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp Thu Jun 12 15:42:12 2014
@@ -34,7 +34,6 @@
using llvm::StringRef;
-using std::error_code;
using namespace llvm::yaml;
using namespace llvm::MachO;
using namespace lld::mach_o::normalized;
@@ -691,8 +690,7 @@ readYaml(std::unique_ptr<MemoryBuffer> &
/// Writes a yaml encoded mach-o files from an in-memory normalized view.
-error_code
-writeYaml(const NormalizedFile &file, raw_ostream &out) {
+std::error_code writeYaml(const NormalizedFile &file, raw_ostream &out) {
// YAML I/O is not const aware, so need to cast away ;-(
NormalizedFile *f = const_cast<NormalizedFile*>(&file);
@@ -704,7 +702,7 @@ writeYaml(const NormalizedFile &file, ra
// Stream out yaml.
yout << *f;
- return error_code();
+ return std::error_code();
}
} // namespace normalized
Modified: lld/trunk/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp?rev=210820&r1=210819&r2=210820&view=diff
==============================================================================
--- lld/trunk/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp (original)
+++ lld/trunk/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp Thu Jun 12 15:42:12 2014
@@ -22,7 +22,6 @@ using llvm::MemoryBuffer;
using llvm::SmallString;
using llvm::Twine;
using llvm::ErrorOr;
-using std::error_code;
using namespace llvm::MachO;
using namespace lld::mach_o::normalized;
@@ -31,7 +30,7 @@ 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 =
@@ -144,7 +143,8 @@ TEST(BinaryWriterTest, obj_relocs_x86_64
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);
@@ -217,7 +217,7 @@ TEST(BinaryWriterTest, obj_relocs_x86_64
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);
}
@@ -255,7 +255,8 @@ TEST(BinaryWriterTest, obj_relocs_x86) {
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);
@@ -326,7 +327,7 @@ TEST(BinaryWriterTest, obj_relocs_x86) {
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);
}
@@ -372,7 +373,8 @@ TEST(BinaryWriterTest, obj_relocs_armv7)
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);
@@ -454,7 +456,7 @@ TEST(BinaryWriterTest, obj_relocs_armv7)
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);
}
@@ -527,7 +529,8 @@ TEST(BinaryWriterTest, obj_relocs_ppc) {
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);
@@ -682,7 +685,7 @@ TEST(BinaryWriterTest, obj_relocs_ppc) {
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);
}
Modified: lld/trunk/utils/linker-script-test/linker-script-test.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/utils/linker-script-test/linker-script-test.cpp?rev=210820&r1=210819&r2=210820&view=diff
==============================================================================
--- lld/trunk/utils/linker-script-test/linker-script-test.cpp (original)
+++ lld/trunk/utils/linker-script-test/linker-script-test.cpp Thu Jun 12 15:42:12 2014
@@ -27,7 +27,7 @@ int main(int argc, const char **argv) {
{
std::unique_ptr<MemoryBuffer> mb;
- if (error_code ec = MemoryBuffer::getFileOrSTDIN(argv[1], mb)) {
+ if (std::error_code ec = MemoryBuffer::getFileOrSTDIN(argv[1], mb)) {
llvm::errs() << ec.message() << "\n";
return 1;
}
@@ -42,7 +42,7 @@ int main(int argc, const char **argv) {
}
{
std::unique_ptr<MemoryBuffer> mb;
- if (error_code ec = MemoryBuffer::getFileOrSTDIN(argv[1], mb)) {
+ if (std::error_code ec = MemoryBuffer::getFileOrSTDIN(argv[1], mb)) {
llvm::errs() << ec.message() << "\n";
return 1;
}
More information about the llvm-commits
mailing list