From 757fcd6d1f7215be8fb90fd5ae5929efd4c21618 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 4 Mar 2014 10:05:20 +0000 Subject: [PATCH] [cleanup] Re-sort includes with llvm/utils/sort_includes.py and fix a missing include from CLog.h. CLog.h referenced most of the core libclang types but never directly included Index.h that provides them. Previously it got lucky and other headers were always included first but with the sorting it ended up first in one case and stopped compiling. Adding the Index.h include fixes it right up. llvm-svn: 202810 --- clang/include/clang/Basic/PlistSupport.h | 2 +- clang/include/clang/Basic/VirtualFileSystem.h | 2 +- clang/lib/Driver/Multilib.cpp | 2 +- clang/lib/Parse/ParseDecl.cpp | 2 +- clang/lib/Parse/ParseDeclCXX.cpp | 2 +- clang/lib/Parse/ParseExpr.cpp | 2 +- clang/lib/Parse/ParseExprCXX.cpp | 2 +- clang/tools/libclang/BuildSystem.cpp | 2 +- clang/tools/libclang/CLog.h | 1 + clang/tools/libclang/CXTranslationUnit.h | 2 +- clang/unittests/Driver/MultilibTest.cpp | 4 ++-- clang/utils/TableGen/ClangAttrEmitter.cpp | 2 +- 12 files changed, 13 insertions(+), 12 deletions(-) diff --git a/clang/include/clang/Basic/PlistSupport.h b/clang/include/clang/Basic/PlistSupport.h index e636ce2a10a7..64853f932a4d 100644 --- a/clang/include/clang/Basic/PlistSupport.h +++ b/clang/include/clang/Basic/PlistSupport.h @@ -10,10 +10,10 @@ #ifndef LLVM_CLANG_PLISTSUPPORT_H #define LLVM_CLANG_PLISTSUPPORT_H -#include "llvm/Support/raw_ostream.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceManager.h" #include "clang/Lex/Lexer.h" +#include "llvm/Support/raw_ostream.h" namespace clang { namespace markup { diff --git a/clang/include/clang/Basic/VirtualFileSystem.h b/clang/include/clang/Basic/VirtualFileSystem.h index a486b5bc8916..3d33c630fe91 100644 --- a/clang/include/clang/Basic/VirtualFileSystem.h +++ b/clang/include/clang/Basic/VirtualFileSystem.h @@ -15,8 +15,8 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" -#include "llvm/Support/FileSystem.h" #include "llvm/Support/ErrorOr.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/SourceMgr.h" namespace llvm { diff --git a/clang/lib/Driver/Multilib.cpp b/clang/lib/Driver/Multilib.cpp index d8b6a45b3674..910e6383f28e 100644 --- a/clang/lib/Driver/Multilib.cpp +++ b/clang/lib/Driver/Multilib.cpp @@ -20,10 +20,10 @@ #include "llvm/Option/Option.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/Support/Regex.h" #include "llvm/Support/YAMLParser.h" #include "llvm/Support/YAMLTraits.h" +#include "llvm/Support/raw_ostream.h" #include using namespace clang::driver; diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 561683f03886..e007998be389 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -13,8 +13,8 @@ #include "clang/Parse/Parser.h" #include "RAIIObjectsForParser.h" -#include "clang/AST/DeclTemplate.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/DeclTemplate.h" #include "clang/Basic/AddressSpaces.h" #include "clang/Basic/CharInfo.h" #include "clang/Parse/ParseDiagnostic.h" diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 33d104075946..c7c8625f2c0c 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -13,8 +13,8 @@ #include "clang/Parse/Parser.h" #include "RAIIObjectsForParser.h" -#include "clang/AST/DeclTemplate.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/DeclTemplate.h" #include "clang/Basic/CharInfo.h" #include "clang/Basic/OperatorKinds.h" #include "clang/Parse/ParseDiagnostic.h" diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index 9e06aff2a1e5..fca6dcda3dd9 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -23,6 +23,7 @@ #include "clang/Parse/Parser.h" #include "RAIIObjectsForParser.h" +#include "clang/AST/ASTContext.h" #include "clang/Basic/PrettyStackTrace.h" #include "clang/Sema/DeclSpec.h" #include "clang/Sema/ParsedTemplate.h" @@ -30,7 +31,6 @@ #include "clang/Sema/TypoCorrection.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallVector.h" -#include "clang/AST/ASTContext.h" using namespace clang; /// \brief Simple precedence-based parser for binary/ternary operators. diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index a74b311395b0..6fd920e7e8dc 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// #include "clang/AST/ASTContext.h" -#include "clang/AST/DeclTemplate.h" #include "RAIIObjectsForParser.h" +#include "clang/AST/DeclTemplate.h" #include "clang/Basic/PrettyStackTrace.h" #include "clang/Lex/LiteralSupport.h" #include "clang/Parse/ParseDiagnostic.h" diff --git a/clang/tools/libclang/BuildSystem.cpp b/clang/tools/libclang/BuildSystem.cpp index ce3762b5be22..4b151e64d582 100644 --- a/clang/tools/libclang/BuildSystem.cpp +++ b/clang/tools/libclang/BuildSystem.cpp @@ -16,8 +16,8 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/Path.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/Support/TimeValue.h" +#include "llvm/Support/raw_ostream.h" using namespace clang; using namespace llvm::sys; diff --git a/clang/tools/libclang/CLog.h b/clang/tools/libclang/CLog.h index 8bf224a1e0a9..fe6c218bbaa5 100644 --- a/clang/tools/libclang/CLog.h +++ b/clang/tools/libclang/CLog.h @@ -10,6 +10,7 @@ #ifndef LLVM_LIBCLANG_CLOG_H #define LLVM_LIBCLANG_CLOG_H +#include "clang-c/Index.h" #include "clang/Basic/LLVM.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/SmallString.h" diff --git a/clang/tools/libclang/CXTranslationUnit.h b/clang/tools/libclang/CXTranslationUnit.h index 0dbb0024b260..13183becf796 100644 --- a/clang/tools/libclang/CXTranslationUnit.h +++ b/clang/tools/libclang/CXTranslationUnit.h @@ -14,8 +14,8 @@ #ifndef LLVM_CLANG_CXTRANSLATIONUNIT_H #define LLVM_CLANG_CXTRANSLATIONUNIT_H -#include "CXString.h" #include "CLog.h" +#include "CXString.h" #include "clang-c/Index.h" namespace clang { diff --git a/clang/unittests/Driver/MultilibTest.cpp b/clang/unittests/Driver/MultilibTest.cpp index 1d8760ddd2f6..dceace536f0f 100644 --- a/clang/unittests/Driver/MultilibTest.cpp +++ b/clang/unittests/Driver/MultilibTest.cpp @@ -13,9 +13,9 @@ #include "clang/Driver/Multilib.h" #include "clang/Basic/LLVM.h" -#include "gtest/gtest.h" -#include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringSwitch.h" +#include "gtest/gtest.h" using namespace clang::driver; using namespace clang; diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp index fd9b4e38db64..44f14229f703 100644 --- a/clang/utils/TableGen/ClangAttrEmitter.cpp +++ b/clang/utils/TableGen/ClangAttrEmitter.cpp @@ -12,9 +12,9 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/SmallString.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/TableGen/Error.h" #include "llvm/TableGen/Record.h" #include "llvm/TableGen/StringMatcher.h" -- GitLab