From 2dea969d8337251e4c9335fd601bd4e0e5dee10f Mon Sep 17 00:00:00 2001 From: Antonio Frighetto Date: Mon, 24 Jul 2023 09:23:31 +0200 Subject: [clang][CodeGen] Introduce `-frecord-command-line` for MachO Allow clang driver command-line recording when targeting MachO object files as well. Reviewed-by: sgraenitz Differential Revision: https://reviews.llvm.org/D155716 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 9e0914f667f0..3994552884c4 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -1420,6 +1420,11 @@ MCSection *TargetLoweringObjectFileMachO::getSectionForConstant( return ReadOnlySection; // .const } +MCSection *TargetLoweringObjectFileMachO::getSectionForCommandLines() const { + return getContext().getMachOSection("__TEXT", "__command_line", 0, + SectionKind::getReadOnly()); +} + const MCExpr *TargetLoweringObjectFileMachO::getTTypeGlobalReference( const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const { -- cgit v1.2.3