Skip to content

Commit d44d9d0

Browse files
committed
[Summary] move summary related logic into a separate library
1 parent 2499ff2 commit d44d9d0

File tree

15 files changed

+47
-31
lines changed

15 files changed

+47
-31
lines changed

clang/include/clang/Frontend/CompilerInstance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "clang/Lex/DependencyDirectivesScanner.h"
2020
#include "clang/Lex/HeaderSearchOptions.h"
2121
#include "clang/Lex/ModuleLoader.h"
22-
#include "clang/Sema/SummaryContext.h"
22+
#include "clang/Summary/SummaryContext.h"
2323
#include "llvm/ADT/ArrayRef.h"
2424
#include "llvm/ADT/DenseMap.h"
2525
#include "llvm/ADT/IntrusiveRefCntPtr.h"

clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "clang/Analysis/DomainSpecific/ObjCNoReturn.h"
2222
#include "clang/Analysis/ProgramPoint.h"
2323
#include "clang/Basic/LLVM.h"
24-
#include "clang/Sema/SummaryContext.h"
2524
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
2625
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h"
2726
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
@@ -35,6 +34,7 @@
3534
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
3635
#include "clang/StaticAnalyzer/Core/PathSensitive/Store.h"
3736
#include "clang/StaticAnalyzer/Core/PathSensitive/WorkList.h"
37+
#include "clang/Summary/SummaryContext.h"
3838
#include "llvm/ADT/ArrayRef.h"
3939
#include <cassert>
4040
#include <optional>

clang/include/clang/Sema/SummaryAttribute.h renamed to clang/include/clang/Summary/SummaryAttribute.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef LLVM_CLANG_SEMA_SEMASUMMARYATTRIBUTE_H
2-
#define LLVM_CLANG_SEMA_SEMASUMMARYATTRIBUTE_H
1+
#ifndef LLVM_CLANG_SUMMARY_SUMMARYATTRIBUTE_H
2+
#define LLVM_CLANG_SUMMARY_SUMMARYATTRIBUTE_H
33

44
#include "clang/AST/Decl.h"
55
#include "clang/ASTMatchers/ASTMatchFinder.h"
@@ -51,4 +51,4 @@ class NoWriteGlobalAttr : public SummaryAttr {
5151
};
5252
} // namespace clang
5353

54-
#endif // LLVM_CLANG_SEMA_SEMASUMMARYATTRIBUTEH
54+
#endif // LLVM_CLANG_SUMMARY_SUMMARYATTRIBUTEH

clang/include/clang/Sema/SummaryConsumer.h renamed to clang/include/clang/Summary/SummaryConsumer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef LLVM_CLANG_SEMA_SUMMARYCONSUMER_H
2-
#define LLVM_CLANG_SEMA_SUMMARYCONSUMER_H
1+
#ifndef LLVM_CLANG_SUMMARY_SUMMARYCONSUMER_H
2+
#define LLVM_CLANG_SUMMARY_SUMMARYCONSUMER_H
33

44
#include "clang/Basic/LLVM.h"
55
#include "llvm/Support/JSON.h"
@@ -27,7 +27,7 @@ class PrintingSummaryConsumer : public SummaryConsumer {
2727
};
2828

2929
class JSONPrintingSummaryConsumer : public PrintingSummaryConsumer {
30-
llvm::json::OStream JOS;
30+
llvm::json::OStream JOS;
3131

3232
public:
3333
JSONPrintingSummaryConsumer(const SummaryContext &SummaryCtx, raw_ostream &OS)
@@ -42,4 +42,4 @@ class JSONPrintingSummaryConsumer : public PrintingSummaryConsumer {
4242
};
4343
} // namespace clang
4444

45-
#endif // LLVM_CLANG_SEMA_SUMMARYCONSUMER_H
45+
#endif // LLVM_CLANG_SUMMARY_SUMMARYCONSUMER_H

clang/include/clang/Sema/SummaryContext.h renamed to clang/include/clang/Summary/SummaryContext.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#ifndef LLVM_CLANG_SEMA_SEMASUMMARYCONTEXT_H
2-
#define LLVM_CLANG_SEMA_SEMASUMMARYCONTEXT_H
1+
#ifndef LLVM_CLANG_SUMMARY_SUMMARYCONTEXT_H
2+
#define LLVM_CLANG_SUMMARY_SUMMARYCONTEXT_H
33

4-
#include "clang/Sema/SummaryAttribute.h"
5-
#include "clang/Sema/SummaryConsumer.h"
4+
#include "clang/Summary/SummaryAttribute.h"
5+
#include "clang/Summary/SummaryConsumer.h"
66
#include <set>
77

88
namespace clang {
@@ -57,4 +57,4 @@ class SummaryContext {
5757
};
5858
} // namespace clang
5959

60-
#endif // LLVM_CLANG_SEMA_SEMASUMMARYCONTEXTH
60+
#endif // LLVM_CLANG_SUMMARY_SUMMARYCONTEXTH

clang/lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ add_subdirectory(CrossTU)
99
add_subdirectory(Sema)
1010
add_subdirectory(CodeGen)
1111
add_subdirectory(Analysis)
12+
add_subdirectory(Summary)
1213
add_subdirectory(Edit)
1314
add_subdirectory(ExtractAPI)
1415
add_subdirectory(Rewrite)

clang/lib/Frontend/CompilerInstance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
#include "clang/Sema/CodeCompleteConsumer.h"
3838
#include "clang/Sema/ParsedAttr.h"
3939
#include "clang/Sema/Sema.h"
40-
#include "clang/Sema/SummaryConsumer.h"
4140
#include "clang/Serialization/ASTReader.h"
4241
#include "clang/Serialization/GlobalModuleIndex.h"
4342
#include "clang/Serialization/InMemoryModuleCache.h"
4443
#include "clang/Serialization/ModuleCache.h"
44+
#include "clang/Summary/SummaryConsumer.h"
4545
#include "llvm/ADT/IntrusiveRefCntPtr.h"
4646
#include "llvm/ADT/STLExtras.h"
4747
#include "llvm/ADT/ScopeExit.h"

clang/lib/Frontend/FrontendAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
#include "clang/Parse/ParseAST.h"
3636
#include "clang/Sema/HLSLExternalSemaSource.h"
3737
#include "clang/Sema/MultiplexExternalSemaSource.h"
38-
#include "clang/Sema/SummaryContext.h"
3938
#include "clang/Serialization/ASTDeserializationListener.h"
4039
#include "clang/Serialization/ASTReader.h"
4140
#include "clang/Serialization/GlobalModuleIndex.h"
41+
#include "clang/Summary/SummaryContext.h"
4242
#include "llvm/ADT/ScopeExit.h"
4343
#include "llvm/ADT/StringRef.h"
4444
#include "llvm/Support/BuryPointer.h"

clang/lib/Sema/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ add_clang_library(clangSema
9898
SemaType.cpp
9999
SemaWasm.cpp
100100
SemaX86.cpp
101-
SummaryAttribute.cpp
102-
SummaryConsumer.cpp
103-
SummaryContext.cpp
104101
TypeLocBuilder.cpp
105102

106103
DEPENDS
@@ -117,4 +114,5 @@ add_clang_library(clangSema
117114
clangEdit
118115
clangLex
119116
clangSupport
117+
clangSummary
120118
)

clang/lib/Sema/Sema.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@
6868
#include "clang/Sema/SemaSystemZ.h"
6969
#include "clang/Sema/SemaWasm.h"
7070
#include "clang/Sema/SemaX86.h"
71-
#include "clang/Sema/SummaryContext.h"
7271
#include "clang/Sema/TemplateDeduction.h"
7372
#include "clang/Sema/TemplateInstCallback.h"
7473
#include "clang/Sema/TypoCorrection.h"
74+
#include "clang/Summary/SummaryContext.h"
7575
#include "llvm/ADT/DenseMap.h"
7676
#include "llvm/ADT/STLExtras.h"
7777
#include "llvm/ADT/SmallPtrSet.h"

0 commit comments

Comments
 (0)