diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h index a72c1b171c3e1..590297fd89a39 100644 --- a/clang/include/clang/Format/Format.h +++ b/clang/include/clang/Format/Format.h @@ -5228,9 +5228,6 @@ extern const char *DefaultFormatStyle; /// Different builds can modify the value to the preferred styles. extern const char *DefaultFallbackStyle; -/// Whether the language is C/C++/Objective-C/Objective-C++. -extern bool IsCpp; - /// Construct a FormatStyle based on ``StyleName``. /// /// ``StyleName`` can take several forms: diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index d5d115a3c8db8..470e79660b5db 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -3915,8 +3915,6 @@ const char *DefaultFormatStyle = "file"; const char *DefaultFallbackStyle = "LLVM"; -bool IsCpp = false; - llvm::ErrorOr> loadAndParseConfigFile(StringRef ConfigFile, llvm::vfs::FileSystem *FS, FormatStyle *Style, bool AllowUnknownOptions) { diff --git a/clang/lib/Format/FormatToken.cpp b/clang/lib/Format/FormatToken.cpp index a63db8cc79527..cd94a9df6cff7 100644 --- a/clang/lib/Format/FormatToken.cpp +++ b/clang/lib/Format/FormatToken.cpp @@ -18,6 +18,8 @@ namespace clang { namespace format { +bool IsCpp = false; + const char *getTokenTypeName(TokenType Type) { static const char *const TokNames[] = { #define TYPE(X) #X, diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h index c9022aba28718..2d6116c43cfad 100644 --- a/clang/lib/Format/FormatToken.h +++ b/clang/lib/Format/FormatToken.h @@ -24,6 +24,9 @@ namespace clang { namespace format { +/// Whether the language is C/C++/Objective-C/Objective-C++. +extern bool IsCpp; + #define LIST_TOKEN_TYPES \ TYPE(ArrayInitializerLSquare) \ TYPE(ArraySubscriptLSquare) \