Skip to content

Commit 0009032

Browse files
authored
[NFC] Minimize header includes (llvm#66339)
Minimize the headers included in header files to reduce the number of files that need recompiled after a change.
1 parent 7e6a5fe commit 0009032

File tree

6 files changed

+25
-8
lines changed

6 files changed

+25
-8
lines changed

clang/include/clang/Basic/AttrSubjectMatchRules.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
#ifndef LLVM_CLANG_BASIC_ATTRSUBJECTMATCHRULES_H
1010
#define LLVM_CLANG_BASIC_ATTRSUBJECTMATCHRULES_H
1111

12-
#include "clang/Basic/SourceLocation.h"
1312
#include "llvm/ADT/DenseMap.h"
1413

1514
namespace clang {
15+
16+
class SourceRange;
17+
1618
namespace attr {
1719

1820
/// A list of all the recognized kinds of attributes.

clang/include/clang/Basic/AttributeCommonInfo.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313

1414
#ifndef LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
1515
#define LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
16+
1617
#include "clang/Basic/SourceLocation.h"
1718
#include "clang/Basic/TokenKinds.h"
1819

1920
namespace clang {
20-
class IdentifierInfo;
21+
2122
class ASTRecordWriter;
23+
class IdentifierInfo;
2224

2325
class AttributeCommonInfo {
2426
public:

clang/include/clang/Basic/Attributes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
#define LLVM_CLANG_BASIC_ATTRIBUTES_H
1111

1212
#include "clang/Basic/AttributeCommonInfo.h"
13-
#include "clang/Basic/LangOptions.h"
14-
#include "clang/Basic/TargetInfo.h"
1513

1614
namespace clang {
1715

1816
class IdentifierInfo;
17+
class LangOptions;
18+
class TargetInfo;
1919

2020
/// Return the version number associated with the attribute if we
2121
/// recognize and implement the attribute specified by the given information.

clang/lib/Basic/Attributes.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1+
//===--- Attributes.cpp ---------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file implements the AttributeCommonInfo interface.
10+
//
11+
//===----------------------------------------------------------------------===//
12+
113
#include "clang/Basic/Attributes.h"
214
#include "clang/Basic/AttrSubjectMatchRules.h"
3-
#include "clang/Basic/AttributeCommonInfo.h"
415
#include "clang/Basic/IdentifierTable.h"
16+
#include "clang/Basic/LangOptions.h"
517
#include "clang/Basic/ParsedAttrInfo.h"
18+
#include "clang/Basic/TargetInfo.h"
19+
620
using namespace clang;
721

822
static int hasAttributeImpl(AttributeCommonInfo::Syntax Syntax, StringRef Name,

clang/lib/Basic/IdentifierTable.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "llvm/ADT/StringMap.h"
2626
#include "llvm/ADT/StringRef.h"
2727
#include "llvm/Support/Allocator.h"
28-
#include "llvm/Support/ErrorHandling.h"
2928
#include "llvm/Support/raw_ostream.h"
3029
#include <cassert>
3130
#include <cstdio>
@@ -52,8 +51,7 @@ namespace {
5251

5352
/// A simple identifier lookup iterator that represents an
5453
/// empty sequence of identifiers.
55-
class EmptyLookupIterator : public IdentifierIterator
56-
{
54+
class EmptyLookupIterator : public IdentifierIterator {
5755
public:
5856
StringRef Next() override { return StringRef(); }
5957
};

clang/lib/Parse/ParseStmt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "clang/AST/PrettyDeclStackTrace.h"
1515
#include "clang/Basic/Attributes.h"
1616
#include "clang/Basic/PrettyStackTrace.h"
17+
#include "clang/Basic/TargetInfo.h"
1718
#include "clang/Basic/TokenKinds.h"
1819
#include "clang/Parse/LoopHint.h"
1920
#include "clang/Parse/Parser.h"

0 commit comments

Comments
 (0)