Skip to content

Commit

Permalink
[clang] Introduce SemaObjC (#89086)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Endilll committed May 13, 2024
1 parent a1d43c1 commit 31a203f
Show file tree
Hide file tree
Showing 38 changed files with 4,897 additions and 4,776 deletions.
11 changes: 6 additions & 5 deletions clang/include/clang/Parse/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "clang/Lex/CodeCompletionHandler.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaObjC.h"
#include "clang/Sema/SemaOpenMP.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Frontend/OpenMP/OMPContext.h"
Expand Down Expand Up @@ -445,8 +446,8 @@ class Parser : public CodeCompletionHandler {
/// True if we are within an Objective-C container while parsing C-like decls.
///
/// This is necessary because Sema thinks we have left the container
/// to parse the C-like decls, meaning Actions.getObjCDeclContext() will
/// be NULL.
/// to parse the C-like decls, meaning Actions.ObjC().getObjCDeclContext()
/// will be NULL.
bool ParsingInObjCContainer;

/// Whether to skip parsing of function bodies.
Expand Down Expand Up @@ -497,7 +498,7 @@ class Parser : public CodeCompletionHandler {
}

ObjCContainerDecl *getObjCDeclContext() const {
return Actions.getObjCDeclContext();
return Actions.ObjC().getObjCDeclContext();
}

// Type forwarding. All of these are statically 'void*', but they may all be
Expand Down Expand Up @@ -1083,11 +1084,11 @@ class Parser : public CodeCompletionHandler {
: P(p), DC(p.getObjCDeclContext()),
WithinObjCContainer(P.ParsingInObjCContainer, DC != nullptr) {
if (DC)
P.Actions.ActOnObjCTemporaryExitContainerContext(DC);
P.Actions.ObjC().ActOnObjCTemporaryExitContainerContext(DC);
}
~ObjCDeclContextSwitch() {
if (DC)
P.Actions.ActOnObjCReenterContainerContext(DC);
P.Actions.ObjC().ActOnObjCReenterContainerContext(DC);
}
};

Expand Down
Loading

0 comments on commit 31a203f

Please sign in to comment.