Skip to content

Commit ebcb04a

Browse files
committed
Revert "[clang][Interp][NFC] Save source location of evaluating expression"
This reverts commit de04e6c. This breaks the Misc/constexpr-source-ranges test: https://lab.llvm.org/buildbot/#/builders/139/builds/64685
1 parent 1c7673b commit ebcb04a

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

clang/lib/AST/Interp/EvalEmitter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ EvalEmitter::~EvalEmitter() {
3434

3535
EvaluationResult EvalEmitter::interpretExpr(const Expr *E,
3636
bool ConvertResultToRValue) {
37-
S.setEvalLocation(E->getExprLoc());
3837
this->ConvertResultToRValue = ConvertResultToRValue;
3938
EvalResult.setSource(E);
4039

clang/lib/AST/Interp/InterpFrame.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,8 @@ Frame *InterpFrame::getCaller() const {
191191
}
192192

193193
SourceRange InterpFrame::getCallRange() const {
194-
if (!Caller->Func) {
195-
if (S.EvalLocation.isValid())
196-
return S.EvalLocation;
194+
if (!Caller->Func)
197195
return S.getRange(nullptr, {});
198-
}
199196
return S.getRange(Caller->Func, RetPC - sizeof(uintptr_t));
200197
}
201198

clang/lib/AST/Interp/InterpState.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ class InterpState final : public State, public SourceMapper {
9898

9999
Context &getContext() const { return Ctx; }
100100

101-
void setEvalLocation(SourceLocation SL) { this->EvalLocation = SL; }
102-
103101
private:
104102
/// AST Walker state.
105103
State &Parent;
@@ -117,8 +115,6 @@ class InterpState final : public State, public SourceMapper {
117115
Context &Ctx;
118116
/// The current frame.
119117
InterpFrame *Current = nullptr;
120-
/// Source location of the evaluating expression
121-
SourceLocation EvalLocation;
122118
};
123119

124120
} // namespace interp

0 commit comments

Comments
 (0)