From 1050e8b2252d89a0004a6fd25a58dab88b5ee625 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 4 Dec 2012 09:45:34 +0000 Subject: [PATCH] Sort the #include lines for unittests/... I've tried to place sensible headers at the top as main-module headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169243 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/AST/CommentLexer.cpp | 9 ++++----- unittests/AST/CommentParser.cpp | 13 ++++++------- unittests/AST/SourceLocationTest.cpp | 2 +- unittests/ASTMatchers/ASTMatchersTest.cpp | 2 +- unittests/Basic/FileManagerTest.cpp | 3 +-- unittests/Basic/SourceManagerTest.cpp | 7 +++---- unittests/Format/FormatTest.cpp | 2 +- unittests/Frontend/FrontendActionTest.cpp | 6 ++---- unittests/Lex/LexerTest.cpp | 10 +++++----- unittests/Lex/PPCallbacksTest.cpp | 4 +--- unittests/Lex/PPConditionalDirectiveRecordTest.cpp | 9 ++++----- unittests/Tooling/RefactoringCallbacksTest.cpp | 6 +++--- unittests/Tooling/RefactoringTest.cpp | 4 ++-- unittests/Tooling/TestVisitor.h | 7 +++---- 14 files changed, 37 insertions(+), 47 deletions(-) diff --git a/unittests/AST/CommentLexer.cpp b/unittests/AST/CommentLexer.cpp index 2723a611e1..f2167e042b 100644 --- a/unittests/AST/CommentLexer.cpp +++ b/unittests/AST/CommentLexer.cpp @@ -7,16 +7,15 @@ // //===----------------------------------------------------------------------===// +#include "clang/AST/CommentLexer.h" #include "clang/Basic/SourceManager.h" -#include "clang/Basic/FileManager.h" +#include "clang/AST/CommentCommandTraits.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticOptions.h" -#include "clang/AST/CommentLexer.h" -#include "clang/AST/CommentCommandTraits.h" +#include "clang/Basic/FileManager.h" #include "llvm/ADT/STLExtras.h" -#include - #include "gtest/gtest.h" +#include using namespace llvm; using namespace clang; diff --git a/unittests/AST/CommentParser.cpp b/unittests/AST/CommentParser.cpp index 8fde2478e7..f9bf58c92e 100644 --- a/unittests/AST/CommentParser.cpp +++ b/unittests/AST/CommentParser.cpp @@ -7,20 +7,19 @@ // //===----------------------------------------------------------------------===// +#include "clang/AST/CommentParser.h" #include "clang/Basic/SourceManager.h" -#include "clang/Basic/FileManager.h" -#include "clang/Basic/Diagnostic.h" -#include "clang/Basic/DiagnosticOptions.h" #include "clang/AST/Comment.h" +#include "clang/AST/CommentCommandTraits.h" #include "clang/AST/CommentLexer.h" -#include "clang/AST/CommentParser.h" #include "clang/AST/CommentSema.h" -#include "clang/AST/CommentCommandTraits.h" +#include "clang/Basic/Diagnostic.h" +#include "clang/Basic/DiagnosticOptions.h" +#include "clang/Basic/FileManager.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Allocator.h" -#include - #include "gtest/gtest.h" +#include using namespace llvm; using namespace clang; diff --git a/unittests/AST/SourceLocationTest.cpp b/unittests/AST/SourceLocationTest.cpp index dec833d15d..eaf9285cf4 100644 --- a/unittests/AST/SourceLocationTest.cpp +++ b/unittests/AST/SourceLocationTest.cpp @@ -17,8 +17,8 @@ //===----------------------------------------------------------------------===// #include "clang/AST/ASTContext.h" -#include "clang/ASTMatchers/ASTMatchers.h" #include "clang/ASTMatchers/ASTMatchFinder.h" +#include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Tooling/Tooling.h" #include "gtest/gtest.h" diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp index 3ec6850845..ad072aa7ce 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -9,8 +9,8 @@ #include "ASTMatchersTest.h" #include "clang/AST/PrettyPrinter.h" -#include "clang/ASTMatchers/ASTMatchers.h" #include "clang/ASTMatchers/ASTMatchFinder.h" +#include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Tooling/Tooling.h" #include "gtest/gtest.h" diff --git a/unittests/Basic/FileManagerTest.cpp b/unittests/Basic/FileManagerTest.cpp index 91998b6388..0a83a3aeb7 100644 --- a/unittests/Basic/FileManagerTest.cpp +++ b/unittests/Basic/FileManagerTest.cpp @@ -7,10 +7,9 @@ // //===----------------------------------------------------------------------===// +#include "clang/Basic/FileManager.h" #include "clang/Basic/FileSystemOptions.h" #include "clang/Basic/FileSystemStatCache.h" -#include "clang/Basic/FileManager.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Basic/SourceManagerTest.cpp b/unittests/Basic/SourceManagerTest.cpp index 477645d7a0..bb20faa412 100644 --- a/unittests/Basic/SourceManagerTest.cpp +++ b/unittests/Basic/SourceManagerTest.cpp @@ -8,20 +8,19 @@ //===----------------------------------------------------------------------===// #include "clang/Basic/SourceManager.h" -#include "clang/Basic/FileManager.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticOptions.h" +#include "clang/Basic/FileManager.h" #include "clang/Basic/LangOptions.h" -#include "clang/Basic/TargetOptions.h" #include "clang/Basic/TargetInfo.h" -#include "clang/Lex/ModuleLoader.h" +#include "clang/Basic/TargetOptions.h" #include "clang/Lex/HeaderSearch.h" #include "clang/Lex/HeaderSearchOptions.h" +#include "clang/Lex/ModuleLoader.h" #include "clang/Lex/Preprocessor.h" #include "clang/Lex/PreprocessorOptions.h" #include "llvm/ADT/SmallString.h" #include "llvm/Config/config.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 9929eebd3b..bb24bb30b2 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// +#include "clang/Format/Format.h" #include "../Tooling/RewriterTestContext.h" #include "clang/Lex/Lexer.h" -#include "clang/Format/Format.h" #include "gtest/gtest.h" namespace clang { diff --git a/unittests/Frontend/FrontendActionTest.cpp b/unittests/Frontend/FrontendActionTest.cpp index 84a65450ba..5b36c67d59 100644 --- a/unittests/Frontend/FrontendActionTest.cpp +++ b/unittests/Frontend/FrontendActionTest.cpp @@ -7,16 +7,14 @@ // //===----------------------------------------------------------------------===// +#include "clang/Frontend/FrontendAction.h" #include "clang/AST/RecursiveASTVisitor.h" -#include "clang/AST/ASTContext.h" #include "clang/AST/ASTConsumer.h" +#include "clang/AST/ASTContext.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Frontend/CompilerInvocation.h" -#include "clang/Frontend/FrontendAction.h" - #include "llvm/ADT/Triple.h" #include "llvm/Support/MemoryBuffer.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Lex/LexerTest.cpp b/unittests/Lex/LexerTest.cpp index d8dd2870b1..ac29ea477b 100644 --- a/unittests/Lex/LexerTest.cpp +++ b/unittests/Lex/LexerTest.cpp @@ -1,4 +1,4 @@ -//===- unittests/Basic/LexerTest.cpp ------ Lexer tests -------------------===// +//===- unittests/Lex/LexerTest.cpp ------ Lexer tests ---------------------===// // // The LLVM Compiler Infrastructure // @@ -7,20 +7,20 @@ // //===----------------------------------------------------------------------===// +#include "clang/Lex/Lexer.h" #include "clang/Basic/SourceManager.h" -#include "clang/Basic/FileManager.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticOptions.h" +#include "clang/Basic/FileManager.h" #include "clang/Basic/LangOptions.h" -#include "clang/Basic/TargetOptions.h" #include "clang/Basic/TargetInfo.h" -#include "clang/Lex/ModuleLoader.h" +#include "clang/Basic/TargetOptions.h" #include "clang/Lex/HeaderSearch.h" #include "clang/Lex/HeaderSearchOptions.h" +#include "clang/Lex/ModuleLoader.h" #include "clang/Lex/Preprocessor.h" #include "clang/Lex/PreprocessorOptions.h" #include "llvm/Config/config.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Lex/PPCallbacksTest.cpp b/unittests/Lex/PPCallbacksTest.cpp index 02b374bc43..295fa407dd 100644 --- a/unittests/Lex/PPCallbacksTest.cpp +++ b/unittests/Lex/PPCallbacksTest.cpp @@ -7,6 +7,7 @@ // //===--------------------------------------------------------------===// +#include "clang/Lex/Preprocessor.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/LangOptions.h" @@ -16,12 +17,9 @@ #include "clang/Lex/HeaderSearch.h" #include "clang/Lex/HeaderSearchOptions.h" #include "clang/Lex/ModuleLoader.h" -#include "clang/Lex/Preprocessor.h" #include "clang/Lex/PreprocessorOptions.h" - #include "llvm/ADT/SmallString.h" #include "llvm/Support/PathV2.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Lex/PPConditionalDirectiveRecordTest.cpp b/unittests/Lex/PPConditionalDirectiveRecordTest.cpp index 21271f9b2f..8db5c9a28b 100644 --- a/unittests/Lex/PPConditionalDirectiveRecordTest.cpp +++ b/unittests/Lex/PPConditionalDirectiveRecordTest.cpp @@ -7,21 +7,20 @@ // //===----------------------------------------------------------------------===// +#include "clang/Lex/PPConditionalDirectiveRecord.h" #include "clang/Basic/SourceManager.h" -#include "clang/Basic/FileManager.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticOptions.h" +#include "clang/Basic/FileManager.h" #include "clang/Basic/LangOptions.h" -#include "clang/Basic/TargetOptions.h" #include "clang/Basic/TargetInfo.h" -#include "clang/Lex/ModuleLoader.h" +#include "clang/Basic/TargetOptions.h" #include "clang/Lex/HeaderSearch.h" #include "clang/Lex/HeaderSearchOptions.h" +#include "clang/Lex/ModuleLoader.h" #include "clang/Lex/Preprocessor.h" #include "clang/Lex/PreprocessorOptions.h" -#include "clang/Lex/PPConditionalDirectiveRecord.h" #include "llvm/Config/config.h" - #include "gtest/gtest.h" using namespace llvm; diff --git a/unittests/Tooling/RefactoringCallbacksTest.cpp b/unittests/Tooling/RefactoringCallbacksTest.cpp index 4e30cfde26..4659efa1e0 100644 --- a/unittests/Tooling/RefactoringCallbacksTest.cpp +++ b/unittests/Tooling/RefactoringCallbacksTest.cpp @@ -1,4 +1,4 @@ -//===- unittest/ASTMatchers/RefactoringCallbacksTest.cpp ------------------===// +//===- unittest/Tooling/RefactoringCallbacksTest.cpp ----------------------===// // // The LLVM Compiler Infrastructure // @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "clang/ASTMatchers/ASTMatchers.h" -#include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/Tooling/RefactoringCallbacks.h" +#include "clang/ASTMatchers/ASTMatchers.h" #include "RewriterTestContext.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" #include "gtest/gtest.h" namespace clang { diff --git a/unittests/Tooling/RefactoringTest.cpp b/unittests/Tooling/RefactoringTest.cpp index ff278bfd52..69aaaa5492 100644 --- a/unittests/Tooling/RefactoringTest.cpp +++ b/unittests/Tooling/RefactoringTest.cpp @@ -8,12 +8,11 @@ //===----------------------------------------------------------------------===// #include "RewriterTestContext.h" -#include "clang/AST/ASTContext.h" #include "clang/AST/ASTConsumer.h" +#include "clang/AST/ASTContext.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclGroup.h" #include "clang/AST/RecursiveASTVisitor.h" -#include "clang/Tooling/Refactoring.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticOptions.h" #include "clang/Basic/FileManager.h" @@ -23,6 +22,7 @@ #include "clang/Frontend/FrontendAction.h" #include "clang/Frontend/TextDiagnosticPrinter.h" #include "clang/Rewrite/Core/Rewriter.h" +#include "clang/Tooling/Refactoring.h" #include "clang/Tooling/Tooling.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/Path.h" diff --git a/unittests/Tooling/TestVisitor.h b/unittests/Tooling/TestVisitor.h index 8333c24a68..ce3246a902 100644 --- a/unittests/Tooling/TestVisitor.h +++ b/unittests/Tooling/TestVisitor.h @@ -15,15 +15,14 @@ #ifndef LLVM_CLANG_TEST_VISITOR_H #define LLVM_CLANG_TEST_VISITOR_H -#include - -#include "clang/AST/ASTContext.h" #include "clang/AST/ASTConsumer.h" +#include "clang/AST/ASTContext.h" #include "clang/AST/RecursiveASTVisitor.h" -#include "clang/Frontend/FrontendAction.h" #include "clang/Frontend/CompilerInstance.h" +#include "clang/Frontend/FrontendAction.h" #include "clang/Tooling/Tooling.h" #include "gtest/gtest.h" +#include namespace clang { -- 2.40.0