================
@@ -2317,8 +2317,14 @@ bool X86AsmParser::ParseIntelInlineAsmIdentifier(
     if (!IsParsingOffsetOperator)
       InstInfo->AsmRewrites->emplace_back(AOK_Label, Loc, Identifier.size(),
                                           InternalName);
-    else
-      Identifier = InternalName;
+    else {
+      // When parsing the offset operator, we need to prepend
+      // PrivateLabelPrefix to match the AOK_Label rewrite at label definition.
+      StringRef Prefix = getContext().getAsmInfo().getPrivateLabelPrefix();
+      SmallString<128> PrefixedName;
+      (Twine(Prefix) + InternalName).toVector(PrefixedName);
+      Identifier = getContext().allocateString(PrefixedName);
----------------
arsenm wrote:

Would it be more correct to use the MCContext::get* function so the symbol is 
known referenced? 

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

Reply via email to