Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/lib/AST/ByteCode/InterpState.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class InterpState final : public State, public SourceMapper {
return Parent.getEvalStatus();
}
ASTContext &getASTContext() const override { return Ctx.getASTContext(); }
const LangOptions &getLangOpts() const {
return Ctx.getASTContext().getLangOpts();
}

// Forward status checks and updates to the walker.
bool keepEvaluatingAfterFailure() const override {
Expand Down
4 changes: 0 additions & 4 deletions clang/lib/AST/ByteCode/State.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ OptionalDiagnostic State::diag(SourceLocation Loc, diag::kind DiagId,
return OptionalDiagnostic();
}

const LangOptions &State::getLangOpts() const {
return getASTContext().getLangOpts();
}

void State::addCallStack(unsigned Limit) {
// Determine which calls to skip, if any.
unsigned ActiveCalls = getCallStackDepth() - 1;
Expand Down
2 changes: 0 additions & 2 deletions clang/lib/AST/ByteCode/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ class State {
/// Directly reports a diagnostic message.
DiagnosticBuilder report(SourceLocation Loc, diag::kind DiagId);

const LangOptions &getLangOpts() const;

/// Whether or not we're in a context where the front end requires a
/// constant value.
bool InConstantContext = false;
Expand Down
1 change: 1 addition & 0 deletions clang/lib/AST/ExprConstant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@ namespace {
}

ASTContext &getASTContext() const override { return Ctx; }
const LangOptions &getLangOpts() const { return Ctx.getLangOpts(); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ grep "Info.getLangOpts()" ../clang/lib/AST/ExprConstant.cpp | wc -l
61

Yep

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, okay i missed that EvalInfo inherits from interp::State - that's fun


void setEvaluatingDecl(APValue::LValueBase Base, APValue &Value,
EvaluatingDeclKind EDK = EvaluatingDeclKind::Ctor) {
Expand Down