================
@@ -242,45 +243,50 @@ static void emitLLDBAsmLabel(llvm::StringRef label, 
GlobalDecl GD,
   Out << label.substr(LLDBManglingABI::FunctionLabelPrefix.size());
 }
 
-void MangleContext::mangleName(GlobalDecl GD, raw_ostream &Out) {
+void MangleContext::mangleName(GlobalDecl GD, raw_ostream &Out,
+                               bool WantAsmLabel) {
   const ASTContext &ASTContext = getASTContext();
   const NamedDecl *D = cast<NamedDecl>(GD.getDecl());
 
   // Any decl can be declared with __asm("foo") on it, and this takes 
precedence
   // over all other naming in the .o file.
-  if (const AsmLabelAttr *ALA = D->getAttr<AsmLabelAttr>()) {
-    // If we have an asm name, then we use it as the mangling.
-
-    // If the label is an alias for an LLVM intrinsic,
-    // do not add a "\01" prefix.
-    if (ALA->getLabel().starts_with("llvm.")) {
-      Out << ALA->getLabel();
-      return;
-    }
+  if (WantAsmLabel) {
+    if (const AsmLabelAttr *ALA = D->getAttr<AsmLabelAttr>()) {
----------------
ojhunt wrote:

Ignoring anything else, this should be

```cpp
if (const AsmLabelAttr *ALA = D->getAttr<AsmLabelAttr>(); ALA && WantAsmLabel) {
```

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

Reply via email to