From: Chandler Carruth Date: Tue, 4 Mar 2014 10:05:20 +0000 (+0000) Subject: [cleanup] Re-sort includes with llvm/utils/sort_includes.py and fix X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de49053bc1fc8082b3a2248389af9d53e2a9daa3;p=clang [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202810 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/PlistSupport.h b/include/clang/Basic/PlistSupport.h index e636ce2a10..64853f932a 100644 --- a/include/clang/Basic/PlistSupport.h +++ b/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/include/clang/Basic/VirtualFileSystem.h b/include/clang/Basic/VirtualFileSystem.h index a486b5bc89..3d33c630fe 100644 --- a/include/clang/Basic/VirtualFileSystem.h +++ b/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/lib/Driver/Multilib.cpp b/lib/Driver/Multilib.cpp index d8b6a45b36..910e6383f2 100644 --- a/lib/Driver/Multilib.cpp +++ b/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/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 561683f038..e007998be3 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/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/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 33d1040759..c7c8625f2c 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/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/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 9e06aff2a1..fca6dcda3d 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/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/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index a74b311395..6fd920e7e8 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/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/tools/libclang/BuildSystem.cpp b/tools/libclang/BuildSystem.cpp index ce3762b5be..4b151e64d5 100644 --- a/tools/libclang/BuildSystem.cpp +++ b/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/tools/libclang/CLog.h b/tools/libclang/CLog.h index 8bf224a1e0..fe6c218bba 100644 --- a/tools/libclang/CLog.h +++ b/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/tools/libclang/CXTranslationUnit.h b/tools/libclang/CXTranslationUnit.h index 0dbb0024b2..13183becf7 100644 --- a/tools/libclang/CXTranslationUnit.h +++ b/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/unittests/Driver/MultilibTest.cpp b/unittests/Driver/MultilibTest.cpp index 1d8760ddd2..dceace536f 100644 --- a/unittests/Driver/MultilibTest.cpp +++ b/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/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp index fd9b4e38db..44f14229f7 100644 --- a/utils/TableGen/ClangAttrEmitter.cpp +++ b/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"