[PATCH] D55616: Emit ASM input in a constant context
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 12 14:34:12 PST 2018
efriedma added inline comments.
================
Comment at: lib/CodeGen/CGStmt.cpp:1825
+ bool Success = false;
+ if (CGM.getCodeGenOpts().OptimizationLevel > 0)
+ Success = InputExpr->EvaluateAsInt(Result, getContext());
----------------
Checking the optimization level here doesn't make sense. If a value is required to be constant in some context, we should evaluate it the same way at all optimization levels.
It's also important that the evaluation here computes the same result as Sema::ActOnGCCAsmStmt; otherwise you could hit an assertion failure.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55616/new/
https://reviews.llvm.org/D55616
More information about the cfe-commits
mailing list