[clang] f3c5278 - [clang-format][NFC] Don't export IsCpp in Format.h

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 17 00:36:20 PDT 2024


Author: Owen Pan
Date: 2024-03-17T00:36:12-07:00
New Revision: f3c5278efa3b783ada9e7a34b751cf4c5b864535

URL: https://github.com/llvm/llvm-project/commit/f3c5278efa3b783ada9e7a34b751cf4c5b864535
DIFF: https://github.com/llvm/llvm-project/commit/f3c5278efa3b783ada9e7a34b751cf4c5b864535.diff

LOG: [clang-format][NFC] Don't export IsCpp in Format.h

Added: 
    

Modified: 
    clang/include/clang/Format/Format.h
    clang/lib/Format/Format.cpp
    clang/lib/Format/FormatToken.cpp
    clang/lib/Format/FormatToken.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index a72c1b171c3e18..590297fd89a398 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 d5d115a3c8db85..470e79660b5db6 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<std::unique_ptr<llvm::MemoryBuffer>>
 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 a63db8cc795277..cd94a9df6cff79 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 c9022aba287187..2d6116c43cfad0 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)                                                  \


        


More information about the cfe-commits mailing list