Skip to content

Commit a0c0dc2

Browse files
committed
Use std::error_code rather than llvm::error_code
std::error_code is no longer available via the llvm namespace as of r210835. Swift SVN r18851
1 parent ca42a7b commit a0c0dc2

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

Diff for: lib/Driver/Driver.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,8 @@ static StringRef getOutputFilename(const JobAction *JA,
818818
// the top level.
819819
StringRef Stem = llvm::sys::path::stem(BaseName);
820820
StringRef Suffix = types::getTypeTempSuffix(JA->getType());
821-
llvm::error_code EC = llvm::sys::fs::createTemporaryFile(Stem, Suffix,
822-
Buffer);
821+
std::error_code EC =
822+
llvm::sys::fs::createTemporaryFile(Stem, Suffix, Buffer);
823823
if (EC) {
824824
Diags.diagnose(SourceLoc(),
825825
diag::error_unable_to_make_temporary_file,

Diff for: lib/IRGen/IRGenDebugInfo.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,9 @@ llvm::DIFile IRGenDebugInfo::getOrCreateFile(const char *Filename) {
500500
StringRef File = BumpAllocatedString(llvm::sys::path::filename(Filename));
501501
llvm::SmallString<512> Path(Filename);
502502
llvm::sys::path::remove_filename(Path);
503-
llvm::error_code ec = llvm::sys::fs::make_absolute(Path);
503+
std::error_code ec = llvm::sys::fs::make_absolute(Path);
504504
// Basically ignore any error.
505-
assert(ec == llvm::error_code());
505+
assert(ec == std::error_code());
506506
(void)ec; // Silence the unused variable warning
507507
llvm::DIFile F = DBuilder.createFile(File, BumpAllocatedString(Path));
508508

Diff for: lib/Serialization/Serialization.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ void Serializer::writeInputFiles(FilenamesTy inputFiles,
424424
for (auto filename : inputFiles) {
425425
llvm::SmallString<128> path(filename);
426426

427-
llvm::error_code err;
427+
std::error_code err;
428428
err = llvm::sys::fs::make_absolute(path);
429429
if (err)
430430
continue;

Diff for: tools/driver/driver.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ int main(int argc_, const char **argv_) {
5454

5555
llvm::SmallVector<const char *, 256> argv;
5656
llvm::SpecificBumpPtrAllocator<char> ArgAllocator;
57-
llvm::error_code EC = llvm::sys::Process::GetArgumentVector(argv,
58-
llvm::ArrayRef<const char *>(argv_, argc_), ArgAllocator);
57+
std::error_code EC = llvm::sys::Process::GetArgumentVector(
58+
argv, llvm::ArrayRef<const char *>(argv_, argc_), ArgAllocator);
5959
if (EC) {
6060
llvm::errs() << "error: couldn't get arguments: " << EC.message() << '\n';
6161
return 1;

Diff for: tools/swift-ide-test/swift-ide-test.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int doCodeCompletion(const CompilerInvocation &InitInvok,
303303
StringRef CodeCompletionToken,
304304
bool CodeCompletionDiagnostics) {
305305
std::unique_ptr<llvm::MemoryBuffer> InputFile;
306-
if (llvm::error_code Err =
306+
if (std::error_code Err =
307307
llvm::MemoryBuffer::getFile(SourceFilename, InputFile)) {
308308
llvm::errs() << "error opening input file: " << Err.message() << '\n';
309309
return 1;
@@ -359,7 +359,7 @@ static int doCodeCompletion(const CompilerInvocation &InitInvok,
359359
static int doREPLCodeCompletion(const CompilerInvocation &InitInvok,
360360
StringRef SourceFilename) {
361361
std::unique_ptr<llvm::MemoryBuffer> InputFile;
362-
if (llvm::error_code Err =
362+
if (std::error_code Err =
363363
llvm::MemoryBuffer::getFile(SourceFilename, InputFile)) {
364364
llvm::errs() << "error opening input file: " << Err.message() << '\n';
365365
return 1;
@@ -904,7 +904,7 @@ static int doSemanticAnnotation(const CompilerInvocation &InitInvok,
904904

905905
static int doInputCompletenessTest(StringRef SourceFilename) {
906906
std::unique_ptr<llvm::MemoryBuffer> InputFile;
907-
if (llvm::error_code Err =
907+
if (std::error_code Err =
908908
llvm::MemoryBuffer::getFile(SourceFilename, InputFile)) {
909909
llvm::errs() << "error opening input file: " << Err.message() << '\n';
910910
return 1;
@@ -1517,7 +1517,7 @@ static int doParseReST(StringRef SourceFilename) {
15171517
llvm::rest::SourceManager<unsigned> SM;
15181518
llvm::SmallString<64> DocutilsXML;
15191519
std::unique_ptr<llvm::MemoryBuffer> InputFile;
1520-
if (llvm::error_code Err =
1520+
if (std::error_code Err =
15211521
llvm::MemoryBuffer::getFileOrSTDIN(SourceFilename, InputFile)) {
15221522
llvm::errs() << "error opening input file: " << Err.message() << '\n';
15231523
return 1;

0 commit comments

Comments
 (0)