2828
2929using clang::format::FormatStyle;
3030
31- LLVM_YAML_IS_SEQUENCE_VECTOR (clang::format:: FormatStyle::RawStringFormat)
31+ LLVM_YAML_IS_SEQUENCE_VECTOR (FormatStyle::RawStringFormat)
3232
3333namespace llvm {
3434namespace yaml {
@@ -1235,7 +1235,7 @@ std::error_code make_error_code(ParseError e) {
12351235 return std::error_code (static_cast <int >(e), getParseCategory ());
12361236}
12371237
1238- inline llvm::Error make_string_error (const llvm:: Twine &Message) {
1238+ inline llvm::Error make_string_error (const Twine &Message) {
12391239 return llvm::make_error<llvm::StringError>(Message,
12401240 llvm::inconvertibleErrorCode ());
12411241}
@@ -2361,7 +2361,7 @@ class JavaScriptRequoter : public TokenAnalyzer {
23612361 // FIXME: handle error. For now, print error message and skip the
23622362 // replacement for release version.
23632363 if (Err) {
2364- llvm::errs () << llvm:: toString (std::move (Err)) << " \n " ;
2364+ llvm::errs () << toString (std::move (Err)) << " \n " ;
23652365 assert (false );
23662366 }
23672367 };
@@ -2802,7 +2802,7 @@ class Cleaner : public TokenAnalyzer {
28022802 // FIXME: better error handling. for now just print error message and skip
28032803 // for the release version.
28042804 if (Err) {
2805- llvm::errs () << llvm:: toString (std::move (Err)) << " \n " ;
2805+ llvm::errs () << toString (std::move (Err)) << " \n " ;
28062806 assert (false && " Fixes must not conflict!" );
28072807 }
28082808 Idx = End + 1 ;
@@ -3074,7 +3074,7 @@ static void sortCppIncludes(const FormatStyle &Style,
30743074 llvm::to_vector<16 >(llvm::seq<unsigned >(0 , Includes.size ()));
30753075
30763076 if (Style.SortIncludes == FormatStyle::SI_CaseInsensitive) {
3077- llvm:: stable_sort (Indices, [&](unsigned LHSI, unsigned RHSI) {
3077+ stable_sort (Indices, [&](unsigned LHSI, unsigned RHSI) {
30783078 const auto LHSFilenameLower = Includes[LHSI].Filename .lower ();
30793079 const auto RHSFilenameLower = Includes[RHSI].Filename .lower ();
30803080 return std::tie (Includes[LHSI].Priority , LHSFilenameLower,
@@ -3083,7 +3083,7 @@ static void sortCppIncludes(const FormatStyle &Style,
30833083 Includes[RHSI].Filename );
30843084 });
30853085 } else {
3086- llvm:: stable_sort (Indices, [&](unsigned LHSI, unsigned RHSI) {
3086+ stable_sort (Indices, [&](unsigned LHSI, unsigned RHSI) {
30873087 return std::tie (Includes[LHSI].Priority , Includes[LHSI].Filename ) <
30883088 std::tie (Includes[RHSI].Priority , Includes[RHSI].Filename );
30893089 });
@@ -3115,7 +3115,7 @@ static void sortCppIncludes(const FormatStyle &Style,
31153115 // enough as additional newlines might be added or removed across #include
31163116 // blocks. This we handle below by generating the updated #include blocks and
31173117 // comparing it to the original.
3118- if (Indices.size () == Includes.size () && llvm:: is_sorted (Indices) &&
3118+ if (Indices.size () == Includes.size () && is_sorted (Indices) &&
31193119 Style.IncludeStyle .IncludeBlocks == tooling::IncludeStyle::IBS_Preserve) {
31203120 return ;
31213121 }
@@ -3154,7 +3154,7 @@ static void sortCppIncludes(const FormatStyle &Style,
31543154 // FIXME: better error handling. For now, just skip the replacement for the
31553155 // release version.
31563156 if (Err) {
3157- llvm::errs () << llvm:: toString (std::move (Err)) << " \n " ;
3157+ llvm::errs () << toString (std::move (Err)) << " \n " ;
31583158 assert (false );
31593159 }
31603160}
@@ -3307,7 +3307,7 @@ static void sortJavaImports(const FormatStyle &Style,
33073307
33083308 bool StaticImportAfterNormalImport =
33093309 Style.SortJavaStaticImport == FormatStyle::SJSIO_After;
3310- llvm:: sort (Indices, [&](unsigned LHSI, unsigned RHSI) {
3310+ sort (Indices, [&](unsigned LHSI, unsigned RHSI) {
33113311 // Negating IsStatic to push static imports above non-static imports.
33123312 return std::make_tuple (!Imports[LHSI].IsStatic ^
33133313 StaticImportAfterNormalImport,
@@ -3357,7 +3357,7 @@ static void sortJavaImports(const FormatStyle &Style,
33573357 // FIXME: better error handling. For now, just skip the replacement for the
33583358 // release version.
33593359 if (Err) {
3360- llvm::errs () << llvm:: toString (std::move (Err)) << " \n " ;
3360+ llvm::errs () << toString (std::move (Err)) << " \n " ;
33613361 assert (false );
33623362 }
33633363}
@@ -3451,7 +3451,7 @@ tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code,
34513451}
34523452
34533453template <typename T>
3454- static llvm:: Expected<tooling::Replacements>
3454+ static Expected<tooling::Replacements>
34553455processReplacements (T ProcessFunc, StringRef Code,
34563456 const tooling::Replacements &Replaces,
34573457 const FormatStyle &Style) {
@@ -3470,7 +3470,7 @@ processReplacements(T ProcessFunc, StringRef Code,
34703470 return Replaces.merge (FormatReplaces);
34713471}
34723472
3473- llvm:: Expected<tooling::Replacements>
3473+ Expected<tooling::Replacements>
34743474formatReplacements (StringRef Code, const tooling::Replacements &Replaces,
34753475 const FormatStyle &Style) {
34763476 // We need to use lambda function here since there are two versions of
@@ -3515,21 +3515,21 @@ fixCppIncludeInsertions(StringRef Code, const tooling::Replacements &Replaces,
35153515 return Replaces;
35163516
35173517 tooling::Replacements HeaderInsertions;
3518- std::set<llvm:: StringRef> HeadersToDelete;
3518+ std::set<StringRef> HeadersToDelete;
35193519 tooling::Replacements Result;
35203520 for (const auto &R : Replaces) {
35213521 if (isHeaderInsertion (R)) {
35223522 // Replacements from \p Replaces must be conflict-free already, so we can
35233523 // simply consume the error.
3524- llvm:: consumeError (HeaderInsertions.add (R));
3524+ consumeError (HeaderInsertions.add (R));
35253525 } else if (isHeaderDeletion (R)) {
35263526 HeadersToDelete.insert (R.getReplacementText ());
35273527 } else if (R.getOffset () == UINT_MAX) {
35283528 llvm::errs () << " Insertions other than header #include insertion are "
35293529 " not supported! "
35303530 << R.getReplacementText () << " \n " ;
35313531 } else {
3532- llvm:: consumeError (Result.add (R));
3532+ consumeError (Result.add (R));
35333533 }
35343534 }
35353535 if (HeaderInsertions.empty () && HeadersToDelete.empty ())
@@ -3546,13 +3546,12 @@ fixCppIncludeInsertions(StringRef Code, const tooling::Replacements &Replaces,
35463546 if (Err) {
35473547 // Ignore the deletion on conflict.
35483548 llvm::errs () << " Failed to add header deletion replacement for "
3549- << Header << " : " << llvm::toString (std::move (Err))
3550- << " \n " ;
3549+ << Header << " : " << toString (std::move (Err)) << " \n " ;
35513550 }
35523551 }
35533552 }
35543553
3555- llvm:: SmallVector<StringRef, 4 > Matches;
3554+ SmallVector<StringRef, 4 > Matches;
35563555 for (const auto &R : HeaderInsertions) {
35573556 auto IncludeDirective = R.getReplacementText ();
35583557 bool Matched =
@@ -3567,7 +3566,7 @@ fixCppIncludeInsertions(StringRef Code, const tooling::Replacements &Replaces,
35673566 if (Replace) {
35683567 auto Err = Result.add (*Replace);
35693568 if (Err) {
3570- llvm:: consumeError (std::move (Err));
3569+ consumeError (std::move (Err));
35713570 unsigned NewOffset =
35723571 Result.getShiftedCodePosition (Replace->getOffset ());
35733572 auto Shifted = tooling::Replacement (FileName, NewOffset, 0 ,
@@ -3581,7 +3580,7 @@ fixCppIncludeInsertions(StringRef Code, const tooling::Replacements &Replaces,
35813580
35823581} // anonymous namespace
35833582
3584- llvm:: Expected<tooling::Replacements>
3583+ Expected<tooling::Replacements>
35853584cleanupAroundReplacements (StringRef Code, const tooling::Replacements &Replaces,
35863585 const FormatStyle &Style) {
35873586 // We need to use lambda function here since there are two versions of
@@ -3774,7 +3773,7 @@ reformat(const FormatStyle &Style, StringRef Code,
37743773 auto Err = NonNoOpFixes.add (Fix);
37753774 if (Err) {
37763775 llvm::errs () << " Error adding replacements : "
3777- << llvm:: toString (std::move (Err)) << " \n " ;
3776+ << toString (std::move (Err)) << " \n " ;
37783777 }
37793778 }
37803779 }
@@ -3956,17 +3955,16 @@ loadAndParseConfigFile(StringRef ConfigFile, llvm::vfs::FileSystem *FS,
39563955 return Text;
39573956}
39583957
3959- llvm:: Expected<FormatStyle> getStyle (StringRef StyleName, StringRef FileName,
3960- StringRef FallbackStyleName ,
3961- StringRef Code, llvm::vfs::FileSystem *FS,
3962- bool AllowUnknownOptions) {
3958+ Expected<FormatStyle> getStyle (StringRef StyleName, StringRef FileName,
3959+ StringRef FallbackStyleName, StringRef Code ,
3960+ llvm::vfs::FileSystem *FS,
3961+ bool AllowUnknownOptions) {
39633962 FormatStyle Style = getLLVMStyle (guessLanguage (FileName, Code));
39643963 FormatStyle FallbackStyle = getNoStyle ();
39653964 if (!getPredefinedStyle (FallbackStyleName, Style.Language , &FallbackStyle))
39663965 return make_string_error (" Invalid fallback style: " + FallbackStyleName);
39673966
3968- llvm::SmallVector<std::unique_ptr<llvm::MemoryBuffer>, 1 >
3969- ChildFormatTextToApply;
3967+ SmallVector<std::unique_ptr<llvm::MemoryBuffer>, 1 > ChildFormatTextToApply;
39703968
39713969 if (StyleName.starts_with (" {" )) {
39723970 // Parse YAML/JSON style from the command line.
@@ -4041,7 +4039,7 @@ llvm::Expected<FormatStyle> getStyle(StringRef StyleName, StringRef FileName,
40414039 };
40424040
40434041 // Look for .clang-format/_clang-format file in the file's parent directories.
4044- llvm:: SmallVector<std::string, 2 > FilesToLookFor;
4042+ SmallVector<std::string, 2 > FilesToLookFor;
40454043 FilesToLookFor.push_back (" .clang-format" );
40464044 FilesToLookFor.push_back (" _clang-format" );
40474045
0 commit comments