Delete unused argument in AArch64MCInstLower constructor: it doesn't
authorAlexey Samsonov <vonosmas@gmail.com>
Tue, 19 Aug 2014 21:51:08 +0000 (21:51 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Tue, 19 Aug 2014 21:51:08 +0000 (21:51 +0000)
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
lib/Target/AArch64/AArch64MCInstLower.cpp
lib/Target/AArch64/AArch64MCInstLower.h

index a437d29161d401a1dd5f1d6d4c00bc125b8a6d3d..8bee4f513517d06f643b676cf088c577db08648d 100644 (file)
@@ -54,7 +54,7 @@ public:
   AArch64AsmPrinter(TargetMachine &TM, MCStreamer &Streamer)
       : AsmPrinter(TM, Streamer),
         Subtarget(&TM.getSubtarget<AArch64Subtarget>()),
-        MCInstLowering(OutContext, *Mang, *this), SM(*this), AArch64FI(nullptr),
+        MCInstLowering(OutContext, *this), SM(*this), AArch64FI(nullptr),
         LOHLabelCounter(0) {}
 
   const char *getPassName() const override {
index 75a17b9dc999f2077f47f8d5965c75608bd777f5..e57b0f4dbb095e4850ce103095ab13b283bbc76d 100644 (file)
@@ -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 *
index e95d9db30796162162748da0bec0a4dfbe89f294..1e29b80c2d626953d292f77027808180b29d708b 100644 (file)
@@ -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;