mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
[clang][Interp] Handle AttributedStmts (#66495)
Just ignore the attributes.
This commit is contained in:
parent
d2e787d5d7
commit
d462bd527a
@ -243,6 +243,8 @@ bool ByteCodeStmtGen<Emitter>::visitStmt(const Stmt *S) {
|
||||
case Stmt::GCCAsmStmtClass:
|
||||
case Stmt::MSAsmStmtClass:
|
||||
return visitAsmStmt(cast<AsmStmt>(S));
|
||||
case Stmt::AttributedStmtClass:
|
||||
return visitAttributedStmt(cast<AttributedStmt>(S));
|
||||
case Stmt::NullStmtClass:
|
||||
return true;
|
||||
default: {
|
||||
@ -625,6 +627,12 @@ bool ByteCodeStmtGen<Emitter>::visitAsmStmt(const AsmStmt *S) {
|
||||
return this->emitInvalid(S);
|
||||
}
|
||||
|
||||
template <class Emitter>
|
||||
bool ByteCodeStmtGen<Emitter>::visitAttributedStmt(const AttributedStmt *S) {
|
||||
// Ignore all attributes.
|
||||
return this->visitStmt(S->getSubStmt());
|
||||
}
|
||||
|
||||
namespace clang {
|
||||
namespace interp {
|
||||
|
||||
|
@ -64,6 +64,7 @@ private:
|
||||
bool visitCaseStmt(const CaseStmt *S);
|
||||
bool visitDefaultStmt(const DefaultStmt *S);
|
||||
bool visitAsmStmt(const AsmStmt *S);
|
||||
bool visitAttributedStmt(const AttributedStmt *S);
|
||||
|
||||
bool emitLambdaStaticInvokerBody(const CXXMethodDecl *MD);
|
||||
|
||||
|
@ -43,4 +43,11 @@ namespace InitDecl {
|
||||
return false;
|
||||
}
|
||||
static_assert(!f2(), "");
|
||||
|
||||
|
||||
constexpr int attrs() {
|
||||
if (1) [[likely]] {}
|
||||
return 1;
|
||||
}
|
||||
static_assert(attrs() == 1, "");
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user