================
@@ -260,6 +276,31 @@ ExprResult Sema::ActOnGCCAsmStmtString(Expr *Expr, bool 
ForAsmLabel) {
     Diag(Expr->getBeginLoc(), diag::err_asm_operand_empty_string);
   }
 
+  // The evaluated string is in the literal encoding (-fexec-charset).
+  // Convert it back to UTF-8
+  if (llvm::TextEncodingConverter *FromLiteral =
+          PP.getTextEncoding().getFromLiteralEncodingConverter()) {
+    unsigned Size = V.getArraySize();
+    std::string Raw;
+    Raw.reserve(Size);
+    for (unsigned I = 0; I < Size; ++I)
+      Raw.push_back(static_cast<char>(
+          V.getArrayInitializedElt(I).getInt().getExtValue()));
----------------
abhina-sree wrote:

thanks this is done 

https://github.com/llvm/llvm-project/pull/169803
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to