[llvm] r224808 - MC: Don't emit .no_dead_strip on targets which don't support it
David Majnemer
david.majnemer at gmail.com
Tue Dec 23 20:11:42 PST 2014
Author: majnemer
Date: Tue Dec 23 22:11:42 2014
New Revision: 224808
URL: http://llvm.org/viewvc/llvm-project?rev=224808&view=rev
Log:
MC: Don't emit .no_dead_strip on targets which don't support it
Modified:
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/test/MC/AsmParser/directive_set.s
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=224808&r1=224807&r2=224808&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Tue Dec 23 22:11:42 2014
@@ -435,7 +435,11 @@ bool MCAsmStreamer::EmitSymbolAttribute(
case MCSA_Internal: OS << "\t.internal\t"; break;
case MCSA_LazyReference: OS << "\t.lazy_reference\t"; break;
case MCSA_Local: OS << "\t.local\t"; break;
- case MCSA_NoDeadStrip: OS << "\t.no_dead_strip\t"; break;
+ case MCSA_NoDeadStrip:
+ if (!MAI->hasNoDeadStrip())
+ return false;
+ OS << "\t.no_dead_strip\t";
+ break;
case MCSA_SymbolResolver: OS << "\t.symbol_resolver\t"; break;
case MCSA_PrivateExtern:
OS << "\t.private_extern\t";
Modified: llvm/trunk/test/MC/AsmParser/directive_set.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_set.s?rev=224808&r1=224807&r2=224808&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_set.s (original)
+++ llvm/trunk/test/MC/AsmParser/directive_set.s Tue Dec 23 22:11:42 2014
@@ -1,12 +1,14 @@
-# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
+# RUN: llvm-mc -triple i386-unknown-elf %s | FileCheck %s
# CHECK: TEST0:
# CHECK: a = 0
+# CHECK-NOT: .no_dead_strip a
TEST0:
.set a, 0
# CHECK: TEST1:
# CHECK: a = 0
+# CHECK-NOT: .no_dead_strip a
TEST1:
.equ a, 0
More information about the llvm-commits
mailing list