[PATCH] D44596: Object: Don't mark alias unconditionally defined

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 9 17:57:32 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL329651: Object: Don't mark alias unconditionally defined (authored by vitalybuka, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D44596?vs=138803&id=141774#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D44596

Files:
  llvm/trunk/lib/Object/RecordStreamer.cpp
  llvm/trunk/test/LTO/X86/symver-asm3.ll


Index: llvm/trunk/test/LTO/X86/symver-asm3.ll
===================================================================
--- llvm/trunk/test/LTO/X86/symver-asm3.ll
+++ llvm/trunk/test/LTO/X86/symver-asm3.ll
@@ -12,18 +12,20 @@
 module asm ".symver foo1, foo@@@VER1"
 ; CHECK-DAG: t foo@@VER1
 
+module asm ".global foo2"
 module asm ".symver foo2, foo@@@VER2"
 ; CHECK-DAG: U foo2
-; CHECK-DAG: t foo at VER2
+; CHECK-DAG: U foo at VER2
+module asm "call foo2"
 
 module asm ".symver foo3, foo@@@VER3"
 ; CHECK-DAG: t foo@@VER3
 
 module asm ".symver foo4, foo@@@VER4"
 ; CHECK-DAG: T foo@@VER4
 
 module asm ".symver foo5, foo@@@VER5"
-; CHECK-DAG: T foo at VER5
+; CHECK-DAG: U foo at VER5
 
 module asm "foo3:"
 ; CHECK-DAG: t foo3
Index: llvm/trunk/lib/Object/RecordStreamer.cpp
===================================================================
--- llvm/trunk/lib/Object/RecordStreamer.cpp
+++ llvm/trunk/lib/Object/RecordStreamer.cpp
@@ -216,7 +216,10 @@
       // TODO: Handle "@@@". Depending on SymbolAttribute value it needs to be
       // converted into @ or @@.
       const MCExpr *Value = MCSymbolRefExpr::create(Aliasee, getContext());
-      EmitAssignment(Alias, Value);
+      if (IsDefined)
+        markDefined(*Alias);
+      // Don't use EmitAssignment override as it always marks alias as defined.
+      MCStreamer::EmitAssignment(Alias, Value);
       if (Attr != MCSA_Invalid)
         EmitSymbolAttribute(Alias, Attr);
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44596.141774.patch
Type: text/x-patch
Size: 1436 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180410/f071cc48/attachment.bin>


More information about the llvm-commits mailing list