From 97eadf21c8ec4dd5e1e669edb3b454231bd4d27a Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Tue, 19 Aug 2014 21:51:08 +0000 Subject: [PATCH] Delete unused argument in AArch64MCInstLower constructor: it doesn't use Mangler, and Mangler is in fact not even created when AArch64MCInstLower is constructed. This bug is reported by UBSan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216030 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AArch64/AArch64AsmPrinter.cpp | 2 +- lib/Target/AArch64/AArch64MCInstLower.cpp | 3 +-- lib/Target/AArch64/AArch64MCInstLower.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Target/AArch64/AArch64AsmPrinter.cpp b/lib/Target/AArch64/AArch64AsmPrinter.cpp index a437d29161d..8bee4f51351 100644 --- a/lib/Target/AArch64/AArch64AsmPrinter.cpp +++ b/lib/Target/AArch64/AArch64AsmPrinter.cpp @@ -54,7 +54,7 @@ public: AArch64AsmPrinter(TargetMachine &TM, MCStreamer &Streamer) : AsmPrinter(TM, Streamer), Subtarget(&TM.getSubtarget()), - MCInstLowering(OutContext, *Mang, *this), SM(*this), AArch64FI(nullptr), + MCInstLowering(OutContext, *this), SM(*this), AArch64FI(nullptr), LOHLabelCounter(0) {} const char *getPassName() const override { diff --git a/lib/Target/AArch64/AArch64MCInstLower.cpp b/lib/Target/AArch64/AArch64MCInstLower.cpp index 75a17b9dc99..e57b0f4dbb0 100644 --- a/lib/Target/AArch64/AArch64MCInstLower.cpp +++ b/lib/Target/AArch64/AArch64MCInstLower.cpp @@ -25,8 +25,7 @@ #include "llvm/Target/TargetMachine.h" using namespace llvm; -AArch64MCInstLower::AArch64MCInstLower(MCContext &ctx, Mangler &mang, - AsmPrinter &printer) +AArch64MCInstLower::AArch64MCInstLower(MCContext &ctx, AsmPrinter &printer) : Ctx(ctx), Printer(printer), TargetTriple(printer.getTargetTriple()) {} MCSymbol * diff --git a/lib/Target/AArch64/AArch64MCInstLower.h b/lib/Target/AArch64/AArch64MCInstLower.h index e95d9db3079..1e29b80c2d6 100644 --- a/lib/Target/AArch64/AArch64MCInstLower.h +++ b/lib/Target/AArch64/AArch64MCInstLower.h @@ -33,7 +33,7 @@ class LLVM_LIBRARY_VISIBILITY AArch64MCInstLower { Triple TargetTriple; public: - AArch64MCInstLower(MCContext &ctx, Mangler &mang, AsmPrinter &printer); + AArch64MCInstLower(MCContext &ctx, AsmPrinter &printer); bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const; void Lower(const MachineInstr *MI, MCInst &OutMI) const; -- 2.34.1