Skip to content

Commit

Permalink
Turn off "statement with no effect" warning for asm with memory clobber
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-kenzel committed May 27, 2024
1 parent 7598431 commit 0f50091
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ bool ImplicitCastExpr::is_constant() const {
}

bool AsmExpr::has_side_effect() const {
return !outs.empty() || std::find(opts.begin(), opts.end(), "volatile") != opts.end();
return !outs.empty() || std::find(opts.begin(), opts.end(), "volatile") != opts.end() || std::find(clobs.begin(), clobs.end(), "memory") != clobs.end();
}

// Patterns ------------------------------------------------------------------------
Expand Down

0 comments on commit 0f50091

Please sign in to comment.