From de49053bc1fc8082b3a2248389af9d53e2a9daa3 Mon Sep 17 00:00:00 2001 From: Chandler Carruth <chandlerc@gmail.com> 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202810 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/PlistSupport.h | 2 +- include/clang/Basic/VirtualFileSystem.h | 2 +- lib/Driver/Multilib.cpp | 2 +- lib/Parse/ParseDecl.cpp | 2 +- lib/Parse/ParseDeclCXX.cpp | 2 +- lib/Parse/ParseExpr.cpp | 2 +- lib/Parse/ParseExprCXX.cpp | 2 +- tools/libclang/BuildSystem.cpp | 2 +- tools/libclang/CLog.h | 1 + tools/libclang/CXTranslationUnit.h | 2 +- unittests/Driver/MultilibTest.cpp | 4 ++-- utils/TableGen/ClangAttrEmitter.cpp | 2 +- 12 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/clang/Basic/PlistSupport.h b/include/clang/Basic/PlistSupport.h index e636ce2a10a..64853f932a4 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 a486b5bc891..3d33c630fe9 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 d8b6a45b367..910e6383f28 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 <algorithm> using namespace clang::driver; diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 561683f0388..e007998be38 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 33d10407594..c7c8625f2c0 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 9e06aff2a1e..fca6dcda3dd 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 a74b311395b..6fd920e7e8d 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 ce3762b5be2..4b151e64d58 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 8bf224a1e0a..fe6c218bbaa 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 0dbb0024b26..13183becf79 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 1d8760ddd2f..dceace536f0 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 fd9b4e38db6..44f14229f70 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" -- GitLab