[clang] [Clang][WIP] Constant Expressions inside of gcc'asm strings (PR #131003)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 12 11:43:51 PDT 2025


================
@@ -497,6 +497,19 @@ void StmtPrinter::VisitReturnStmt(ReturnStmt *Node) {
   if (Policy.IncludeNewlines) OS << NL;
 }
 
+static void PrintGCCAsmString(raw_ostream &OS, Expr*E) {
+  if(E->getDependence()) {
+    OS << "<<dependent expr>>";
+    return;
+  }
+
+  std::string Str = GCCAsmStmt::ExtractStringFromGCCAsmStmtComponent(E);
----------------
erichkeane wrote:

Do we really want to do this instead of printing the expression?  Seems weird that `-ast-print` would be changing the value here.

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


More information about the cfe-commits mailing list