Skip to content

Commit 31a203f

Browse files
authored
[clang] Introduce SemaObjC (#89086)
This is continuation of efforts to split `Sema` up, following the example of OpenMP, OpenACC, etc. Context can be found in #82217 and #84184. I split formatting changes into a separate commit to help reviewing the actual changes.
1 parent a1d43c1 commit 31a203f

38 files changed

+4897
-4776
lines changed

clang/include/clang/Parse/Parser.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "clang/Lex/CodeCompletionHandler.h"
1919
#include "clang/Lex/Preprocessor.h"
2020
#include "clang/Sema/Sema.h"
21+
#include "clang/Sema/SemaObjC.h"
2122
#include "clang/Sema/SemaOpenMP.h"
2223
#include "llvm/ADT/SmallVector.h"
2324
#include "llvm/Frontend/OpenMP/OMPContext.h"
@@ -445,8 +446,8 @@ class Parser : public CodeCompletionHandler {
445446
/// True if we are within an Objective-C container while parsing C-like decls.
446447
///
447448
/// This is necessary because Sema thinks we have left the container
448-
/// to parse the C-like decls, meaning Actions.getObjCDeclContext() will
449-
/// be NULL.
449+
/// to parse the C-like decls, meaning Actions.ObjC().getObjCDeclContext()
450+
/// will be NULL.
450451
bool ParsingInObjCContainer;
451452

452453
/// Whether to skip parsing of function bodies.
@@ -497,7 +498,7 @@ class Parser : public CodeCompletionHandler {
497498
}
498499

499500
ObjCContainerDecl *getObjCDeclContext() const {
500-
return Actions.getObjCDeclContext();
501+
return Actions.ObjC().getObjCDeclContext();
501502
}
502503

503504
// Type forwarding. All of these are statically 'void*', but they may all be
@@ -1083,11 +1084,11 @@ class Parser : public CodeCompletionHandler {
10831084
: P(p), DC(p.getObjCDeclContext()),
10841085
WithinObjCContainer(P.ParsingInObjCContainer, DC != nullptr) {
10851086
if (DC)
1086-
P.Actions.ActOnObjCTemporaryExitContainerContext(DC);
1087+
P.Actions.ObjC().ActOnObjCTemporaryExitContainerContext(DC);
10871088
}
10881089
~ObjCDeclContextSwitch() {
10891090
if (DC)
1090-
P.Actions.ActOnObjCReenterContainerContext(DC);
1091+
P.Actions.ObjC().ActOnObjCReenterContainerContext(DC);
10911092
}
10921093
};
10931094

0 commit comments

Comments
 (0)