[clang] [CIR] Implement codegen for inline assembly with output operands (PR #154014)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 19 08:50:07 PDT 2025


================
@@ -26,6 +28,98 @@ static AsmFlavor inferFlavor(const CIRGenModule &cgm, const AsmStmt &s) {
   return isa<MSAsmStmt>(&s) ? AsmFlavor::x86_intel : gnuAsmFlavor;
 }
 
+// FIXME(cir): This should be a common helper between CIRGen
+// and traditional CodeGen
+static std::string simplifyConstraint(
+    const char *constraint, const TargetInfo &target,
----------------
andykaylor wrote:

This code relies on the assumption that `constraint` is zero-terminated. That's guaranteed by the fact that the call site is using std::string::c_str() to get the pointer, but in general it's not a safe assumption, so it might be a good idea to change the interface to take a std::string reference argument when you move the code.

https://github.com/llvm/llvm-project/pull/154014


More information about the cfe-commits mailing list