[clang] Expose CoawaitExpr's operand in the AST
authorNathan Ridge <zeratul976@hotmail.com>
Mon, 4 Apr 2022 06:29:21 +0000 (02:29 -0400)
committerNathan Ridge <zeratul976@hotmail.com>
Tue, 17 May 2022 12:13:37 +0000 (08:13 -0400)
commitdf2a4eae6b190806c0b96ef3312975e1c97dbda0
tree710ab9bf707a0416744de4ceb888c2f86cf00746
parent77480556c41fbca36b918323c69cb77f8e02b56c
[clang] Expose CoawaitExpr's operand in the AST

Previously the Expr returned by getOperand() was actually the
subexpression common to the "ready", "suspend", and "resume"
expressions, which often isn't just the operand but e.g.
await_transform() called on the operand.

It's important for the AST to expose the operand as written
in the source for traversals and tools like clangd to work
correctly.

Fixes https://github.com/clangd/clangd/issues/939

Differential Revision: https://reviews.llvm.org/D115187
clang-tools-extra/clangd/unittests/FindTargetTests.cpp
clang/include/clang/AST/ExprCXX.h
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaCoroutine.cpp
clang/lib/Sema/TreeTransform.h
clang/test/AST/coroutine-locals-cleanup-exp-namespace.cpp
clang/test/AST/coroutine-locals-cleanup.cpp
clang/test/AST/coroutine-source-location-crash-exp-namespace.cpp
clang/test/AST/coroutine-source-location-crash.cpp
clang/test/SemaCXX/co_await-ast.cpp [new file with mode: 0644]