-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[Clang] Replace include with forward declaration (NFC) #151292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang Author: Nikita Popov (nikic) ChangesAfter #142541. Full diff: https://github.com/llvm/llvm-project/pull/151292.diff 1 Files Affected:
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 708c6e2925fd0..6c124aa96cdb4 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -16,7 +16,6 @@
#include "clang/AST/APNumericStorage.h"
#include "clang/AST/APValue.h"
#include "clang/AST/ASTVector.h"
-#include "clang/AST/Attr.h"
#include "clang/AST/ComputeDependence.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclAccessPair.h"
@@ -58,6 +57,7 @@ namespace clang {
class StringLiteral;
class TargetInfo;
class ValueDecl;
+ class WarnUnusedResultAttr;
/// A simple array of base specifiers.
typedef SmallVector<CXXBaseSpecifier*, 4> CXXCastPath;
|
You can test this locally with the following command:git-clang-format --diff HEAD~1 HEAD --extensions h -- clang/include/clang/AST/Expr.h View the diff from clang-format here.diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 6c124aa96..4b49a0d50 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -59,50 +59,51 @@ namespace clang {
class ValueDecl;
class WarnUnusedResultAttr;
-/// A simple array of base specifiers.
-typedef SmallVector<CXXBaseSpecifier*, 4> CXXCastPath;
-
-/// An adjustment to be made to the temporary created when emitting a
-/// reference binding, which accesses a particular subobject of that temporary.
-struct SubobjectAdjustment {
- enum {
- DerivedToBaseAdjustment,
- FieldAdjustment,
- MemberPointerAdjustment
- } Kind;
-
- struct DTB {
- const CastExpr *BasePath;
- const CXXRecordDecl *DerivedClass;
- };
+ /// A simple array of base specifiers.
+ typedef SmallVector<CXXBaseSpecifier *, 4> CXXCastPath;
+
+ /// An adjustment to be made to the temporary created when emitting a
+ /// reference binding, which accesses a particular subobject of that
+ /// temporary.
+ struct SubobjectAdjustment {
+ enum {
+ DerivedToBaseAdjustment,
+ FieldAdjustment,
+ MemberPointerAdjustment
+ } Kind;
+
+ struct DTB {
+ const CastExpr *BasePath;
+ const CXXRecordDecl *DerivedClass;
+ };
- struct P {
- const MemberPointerType *MPT;
- Expr *RHS;
- };
+ struct P {
+ const MemberPointerType *MPT;
+ Expr *RHS;
+ };
- union {
- struct DTB DerivedToBase;
- const FieldDecl *Field;
- struct P Ptr;
- };
+ union {
+ struct DTB DerivedToBase;
+ const FieldDecl *Field;
+ struct P Ptr;
+ };
- SubobjectAdjustment(const CastExpr *BasePath,
- const CXXRecordDecl *DerivedClass)
- : Kind(DerivedToBaseAdjustment) {
- DerivedToBase.BasePath = BasePath;
- DerivedToBase.DerivedClass = DerivedClass;
- }
+ SubobjectAdjustment(const CastExpr *BasePath,
+ const CXXRecordDecl *DerivedClass)
+ : Kind(DerivedToBaseAdjustment) {
+ DerivedToBase.BasePath = BasePath;
+ DerivedToBase.DerivedClass = DerivedClass;
+ }
- SubobjectAdjustment(const FieldDecl *Field) : Kind(FieldAdjustment) {
- this->Field = Field;
- }
+ SubobjectAdjustment(const FieldDecl *Field) : Kind(FieldAdjustment) {
+ this->Field = Field;
+ }
- SubobjectAdjustment(const MemberPointerType *MPT, Expr *RHS)
- : Kind(MemberPointerAdjustment) {
- this->Ptr.MPT = MPT;
- this->Ptr.RHS = RHS;
- }
+ SubobjectAdjustment(const MemberPointerType *MPT, Expr *RHS)
+ : Kind(MemberPointerAdjustment) {
+ this->Ptr.MPT = MPT;
+ this->Ptr.RHS = RHS;
+ }
};
/// This represents one expression. Note that Expr's are subclasses of Stmt.
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/13848 Here is the relevant piece of the build log for the reference
|
After #142541.