aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@jrtc27.com>2025-05-18 20:09:43 +0100
committerGitHub <noreply@github.com>2025-05-18 20:09:43 +0100
commit1b41599cf8972abbf0d2ee7595dba78a4b158af0 (patch)
treedc73a47a91632a5cd504ee4b9e8781753cb59675 /llvm/lib/MC/MCStreamer.cpp
parent5fa985e751c8f890fff31e190473aeeb6f7a9fc5 (diff)
downloadllvm-1b41599cf8972abbf0d2ee7595dba78a4b158af0.zip
llvm-1b41599cf8972abbf0d2ee7595dba78a4b158af0.tar.gz
llvm-1b41599cf8972abbf0d2ee7595dba78a4b158af0.tar.bz2
[MC][AArch64][ARM][X86] Push target-dependent assembler flags into targets (#139844)
The .syntax unified directive and .codeX/.code X directives are, other than some simple common printing code, exclusively implemented in the targets themselves. Thus, remove the corresponding MCAF_* flags and reimplement the directives solely within the targets. This avoids exposing all targets to all other targets' flags. Since MCAF_SubsectionsViaSymbols is all that remains, convert it to its own function like other directives, simplifying its implementation. Note that, on X86, we now always need a target streamer when parsing assembly, as it's now used for directives that aren't COFF-specific. It still does not however need to do anything when producing a non-COFF object file, so this commit does not introduce any new target streamers. There is some churn in test output, and corresponding UTC regex changes, due to comments no longer being flushed by these various directives (and EmitEOL is not exposed outside MCAsmStreamer.cpp so we couldn't do so even if we wanted to), but that was a bit odd to be doing anyway. This is motivated by Morello LLVM, which adds yet another assembler flag to distinguish A64 and C64 instruction sets, but did not update every switch and so emits warnings during the build. Rather than fix those warnings it seems better to instead make the problem not exist in the first place via this change.
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCStreamer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index a196842..618a35b 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -1245,7 +1245,10 @@ void MCStreamer::emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi,
emitULEB128Value(Diff);
}
-void MCStreamer::emitAssemblerFlag(MCAssemblerFlag Flag) {}
+void MCStreamer::emitSubsectionsViaSymbols() {
+ llvm_unreachable(
+ "emitSubsectionsViaSymbols only supported on Mach-O targets");
+}
void MCStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
void MCStreamer::beginCOFFSymbolDef(const MCSymbol *Symbol) {
llvm_unreachable("this directive only supported on COFF targets");