]> granicus.if.org Git - clang/commitdiff
clang-format: Allow include of clangFormat.h in managed context
authorMarianne Mailhot-Sarrasin <marianne.mailhot.sarrasin@gmail.com>
Thu, 14 Apr 2016 14:47:37 +0000 (14:47 +0000)
committerMarianne Mailhot-Sarrasin <marianne.mailhot.sarrasin@gmail.com>
Thu, 14 Apr 2016 14:47:37 +0000 (14:47 +0000)
Including VirtualFileSystem.h in the clangFormat.h indirectly includes <atomic>.
This header is blocked when compiling with /clr.

Patch by Maxime Beaulieu

Differential Revision: http://reviews.llvm.org/D19064

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266319 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Format/Format.h
lib/Format/Format.cpp

index fbb7ab46dfd563011004d648a6a39443b7f83049..2acec268a223df0666643c3f03eab855b100d112 100644 (file)
@@ -16,7 +16,6 @@
 #define LLVM_CLANG_FORMAT_FORMAT_H
 
 #include "clang/Basic/LangOptions.h"
-#include "clang/Basic/VirtualFileSystem.h"
 #include "clang/Tooling/Core/Replacement.h"
 #include "llvm/ADT/ArrayRef.h"
 #include <system_error>
@@ -27,6 +26,10 @@ class Lexer;
 class SourceManager;
 class DiagnosticConsumer;
 
+namespace vfs {
+class FileSystem;
+}
+
 namespace format {
 
 enum class ParseError { Success = 0, Error, Unsuitable };
index 37788df23de86ed5f649b9eab64b9a992fcfcca1..cc11d3df400c04a27741a5c2af77db2ce9a2d061 100644 (file)
@@ -22,6 +22,7 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/DiagnosticOptions.h"
 #include "clang/Basic/SourceManager.h"
+#include "clang/Basic/VirtualFileSystem.h"
 #include "clang/Lex/Lexer.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/Allocator.h"