From 96b033006d9959b2e944779ea8836f2c81cc7e2b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 11 Jun 2014 19:05:55 +0000 Subject: Use std::error_code instead of llvm::error_code. This is an update for a llvm api change. llvm-svn: 210688 --- clang/lib/Format/Format.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'clang/lib/Format') diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index f497126950d..e3378d14460 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -447,7 +447,7 @@ llvm::error_code parseConfiguration(StringRef Text, FormatStyle *Style) { FormatStyle::LanguageKind Language = Style->Language; assert(Language != FormatStyle::LK_None); if (Text.trim().empty()) - return llvm::make_error_code(llvm::errc::invalid_argument); + return llvm::make_error_code(std::errc::invalid_argument); std::vector Styles; llvm::yaml::Input Input(Text); @@ -463,14 +463,14 @@ llvm::error_code parseConfiguration(StringRef Text, FormatStyle *Style) { for (unsigned i = 0; i < Styles.size(); ++i) { // Ensures that only the first configuration can skip the Language option. if (Styles[i].Language == FormatStyle::LK_None && i != 0) - return llvm::make_error_code(llvm::errc::invalid_argument); + return llvm::make_error_code(std::errc::invalid_argument); // Ensure that each language is configured at most once. for (unsigned j = 0; j < i; ++j) { if (Styles[i].Language == Styles[j].Language) { DEBUG(llvm::dbgs() << "Duplicate languages in the config file on positions " << j << " and " << i << "\n"); - return llvm::make_error_code(llvm::errc::invalid_argument); + return llvm::make_error_code(std::errc::invalid_argument); } } } @@ -485,7 +485,7 @@ llvm::error_code parseConfiguration(StringRef Text, FormatStyle *Style) { return llvm::error_code(); } } - return llvm::make_error_code(llvm::errc::not_supported); + return llvm::make_error_code(std::errc::not_supported); } std::string configurationAsText(const FormatStyle &Style) { @@ -2049,7 +2049,7 @@ FormatStyle getStyle(StringRef StyleName, StringRef FileName, break; } if (llvm::error_code ec = parseConfiguration(Text->getBuffer(), &Style)) { - if (ec == llvm::errc::not_supported) { + if (ec == std::errc::not_supported) { if (!UnsuitableConfigFiles.empty()) UnsuitableConfigFiles.append(", "); UnsuitableConfigFiles.append(ConfigFile); -- cgit v1.2.3