[clang-tools-extra] r338696 - Replace hardcoded format styles in a few tools with the default style in libFormat.
Eric Liu via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 2 03:30:56 PDT 2018
Author: ioeric
Date: Thu Aug 2 03:30:56 2018
New Revision: 338696
URL: http://llvm.org/viewvc/llvm-project?rev=338696&view=rev
Log:
Replace hardcoded format styles in a few tools with the default style in libFormat.
Modified:
clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
clang-tools-extra/trunk/clang-move/ClangMove.cpp
clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp
Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp?rev=338696&r1=338695&r2=338696&view=diff
==============================================================================
--- clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp (original)
+++ clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp Thu Aug 2 03:30:56 2018
@@ -989,7 +989,8 @@ void ChangeNamespaceTool::onEndOfTransla
// Add replacements referring to the changed code to existing replacements,
// which refers to the original code.
Replaces = Replaces.merge(NewReplacements);
- auto Style = format::getStyle("file", FilePath, FallbackStyle);
+ auto Style =
+ format::getStyle(format::DefaultFormatStyle, FilePath, FallbackStyle);
if (!Style) {
llvm::errs() << llvm::toString(Style.takeError()) << "\n";
continue;
Modified: clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp?rev=338696&r1=338695&r2=338696&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp (original)
+++ clang-tools-extra/trunk/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp Thu Aug 2 03:30:56 2018
@@ -97,8 +97,8 @@ int main(int argc, char **argv) {
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts.get());
// Determine a formatting style from options.
- auto FormatStyleOrError =
- format::getStyle(FormatStyleOpt, FormatStyleConfig, "LLVM");
+ auto FormatStyleOrError = format::getStyle(FormatStyleOpt, FormatStyleConfig,
+ format::DefaultFallbackStyle);
if (!FormatStyleOrError) {
llvm::errs() << llvm::toString(FormatStyleOrError.takeError()) << "\n";
return 1;
Modified: clang-tools-extra/trunk/clang-move/ClangMove.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-move/ClangMove.cpp?rev=338696&r1=338695&r2=338696&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-move/ClangMove.cpp (original)
+++ clang-tools-extra/trunk/clang-move/ClangMove.cpp Thu Aug 2 03:30:56 2018
@@ -795,7 +795,8 @@ void ClangMoveTool::removeDeclsInOldFile
// Ignore replacements for new.h/cc.
if (SI == FilePathToFileID.end()) continue;
llvm::StringRef Code = SM.getBufferData(SI->second);
- auto Style = format::getStyle("file", FilePath, Context->FallbackStyle);
+ auto Style = format::getStyle(format::DefaultFormatStyle, FilePath,
+ Context->FallbackStyle);
if (!Style) {
llvm::errs() << llvm::toString(Style.takeError()) << "\n";
continue;
Modified: clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp?rev=338696&r1=338695&r2=338696&view=diff
==============================================================================
--- clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp (original)
+++ clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp Thu Aug 2 03:30:56 2018
@@ -324,7 +324,8 @@ int includeFixerMain(int argc, const cha
const IncludeFixerContext::HeaderInfo &RHS) {
return LHS.QualifiedName == RHS.QualifiedName;
});
- auto InsertStyle = format::getStyle("file", Context.getFilePath(), Style);
+ auto InsertStyle = format::getStyle(format::DefaultFormatStyle,
+ Context.getFilePath(), Style);
if (!InsertStyle) {
llvm::errs() << llvm::toString(InsertStyle.takeError()) << "\n";
return 1;
@@ -402,7 +403,8 @@ int includeFixerMain(int argc, const cha
std::vector<tooling::Replacements> FixerReplacements;
for (const auto &Context : Contexts) {
StringRef FilePath = Context.getFilePath();
- auto InsertStyle = format::getStyle("file", FilePath, Style);
+ auto InsertStyle =
+ format::getStyle(format::DefaultFormatStyle, FilePath, Style);
if (!InsertStyle) {
llvm::errs() << llvm::toString(InsertStyle.takeError()) << "\n";
return 1;
More information about the cfe-commits
mailing list