Skip to content

Commit

Permalink
Remove redundant void arguments (NFC)
Browse files Browse the repository at this point in the history
Identified by modernize-redundant-void-arg.
  • Loading branch information
kazutakahirata committed Jan 2, 2022
1 parent 677bbec commit 7e163af
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 34 deletions.
2 changes: 1 addition & 1 deletion lldb/include/lldb/Symbol/UnwindPlan.h
Expand Up @@ -442,7 +442,7 @@ class UnwindPlan {
m_return_addr_register = regnum;
}

uint32_t GetReturnAddressRegister(void) { return m_return_addr_register; }
uint32_t GetReturnAddressRegister() { return m_return_addr_register; }

uint32_t GetInitialCFARegister() const {
if (m_row_list.empty())
Expand Down
4 changes: 1 addition & 3 deletions lldb/source/Target/Thread.cpp
Expand Up @@ -471,9 +471,7 @@ void Thread::SetStopInfoToNothing() {
StopInfo::CreateStopReasonWithSignal(*this, LLDB_INVALID_SIGNAL_NUMBER));
}

bool Thread::ThreadStoppedForAReason(void) {
return (bool)GetPrivateStopInfo();
}
bool Thread::ThreadStoppedForAReason() { return (bool)GetPrivateStopInfo(); }

bool Thread::CheckpointThreadState(ThreadStateCheckpoint &saved_state) {
saved_state.register_backup_sp.reset();
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/MCA/Instruction.h
Expand Up @@ -406,7 +406,7 @@ class CycleSegment {
bool operator<(const CycleSegment &Other) const {
return Begin < Other.Begin;
}
CycleSegment &operator--(void) {
CycleSegment &operator--() {
if (Begin)
Begin--;
if (End)
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
Expand Up @@ -494,7 +494,7 @@ class MLocTracker {
return StackIdxesToPos.find(Idx)->second;
}

unsigned getNumLocs(void) const { return LocIdxToIDNum.size(); }
unsigned getNumLocs() const { return LocIdxToIDNum.size(); }

/// Reset all locations to contain a PHI value at the designated block. Used
/// sometimes for actual PHI values, othertimes to indicate the block entry
Expand All @@ -516,7 +516,7 @@ class MLocTracker {
}

/// Wipe any un-necessary location records after traversing a block.
void reset(void) {
void reset() {
// We could reset all the location values too; however either loadFromArray
// or setMPhis should be called before this object is re-used. Just
// clear Masks, they're definitely not needed.
Expand All @@ -525,7 +525,7 @@ class MLocTracker {

/// Clear all data. Destroys the LocID <=> LocIdx map, which makes most of
/// the information in this pass uninterpretable.
void clear(void) {
void clear() {
reset();
LocIDToLocIdx.clear();
LocIdxToLocID.clear();
Expand Down
10 changes: 5 additions & 5 deletions llvm/lib/CodeGen/TypePromotion.cpp
Expand Up @@ -116,11 +116,11 @@ class IRPromoter {
SmallPtrSet<Value*, 8> Promoted;

void ReplaceAllUsersOfWith(Value *From, Value *To);
void ExtendSources(void);
void ConvertTruncs(void);
void PromoteTree(void);
void TruncateSinks(void);
void Cleanup(void);
void ExtendSources();
void ConvertTruncs();
void PromoteTree();
void TruncateSinks();
void Cleanup();

public:
IRPromoter(LLVMContext &C, IntegerType *Ty, unsigned Width,
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/BPF/BPFMIChecking.cpp
Expand Up @@ -41,7 +41,7 @@ struct BPFMIPreEmitChecking : public MachineFunctionPass {
// Initialize class variables.
void initialize(MachineFunction &MFParm);

bool processAtomicInsts(void);
bool processAtomicInsts();

public:

Expand Down Expand Up @@ -151,7 +151,7 @@ static bool hasLiveDefs(const MachineInstr &MI, const TargetRegisterInfo *TRI) {
return false;
}

bool BPFMIPreEmitChecking::processAtomicInsts(void) {
bool BPFMIPreEmitChecking::processAtomicInsts() {
for (MachineBasicBlock &MBB : *MF) {
for (MachineInstr &MI : MBB) {
if (MI.getOpcode() != BPF::XADDW &&
Expand Down
16 changes: 8 additions & 8 deletions llvm/lib/Target/BPF/BPFMIPeephole.cpp
Expand Up @@ -56,8 +56,8 @@ struct BPFMIPeephole : public MachineFunctionPass {
bool isInsnFrom32Def(MachineInstr *DefInsn);
bool isPhiFrom32Def(MachineInstr *MovMI);
bool isMovFrom32Def(MachineInstr *MovMI);
bool eliminateZExtSeq(void);
bool eliminateZExt(void);
bool eliminateZExtSeq();
bool eliminateZExt();

std::set<MachineInstr *> PhiInsns;

Expand Down Expand Up @@ -172,7 +172,7 @@ bool BPFMIPeephole::isMovFrom32Def(MachineInstr *MovMI)
return true;
}

bool BPFMIPeephole::eliminateZExtSeq(void) {
bool BPFMIPeephole::eliminateZExtSeq() {
MachineInstr* ToErase = nullptr;
bool Eliminated = false;

Expand Down Expand Up @@ -240,7 +240,7 @@ bool BPFMIPeephole::eliminateZExtSeq(void) {
return Eliminated;
}

bool BPFMIPeephole::eliminateZExt(void) {
bool BPFMIPeephole::eliminateZExt() {
MachineInstr* ToErase = nullptr;
bool Eliminated = false;

Expand Down Expand Up @@ -312,7 +312,7 @@ struct BPFMIPreEmitPeephole : public MachineFunctionPass {
// Initialize class variables.
void initialize(MachineFunction &MFParm);

bool eliminateRedundantMov(void);
bool eliminateRedundantMov();

public:

Expand All @@ -334,7 +334,7 @@ void BPFMIPreEmitPeephole::initialize(MachineFunction &MFParm) {
LLVM_DEBUG(dbgs() << "*** BPF PreEmit peephole pass ***\n\n");
}

bool BPFMIPreEmitPeephole::eliminateRedundantMov(void) {
bool BPFMIPreEmitPeephole::eliminateRedundantMov() {
MachineInstr* ToErase = nullptr;
bool Eliminated = false;

Expand Down Expand Up @@ -405,7 +405,7 @@ struct BPFMIPeepholeTruncElim : public MachineFunctionPass {
// Initialize class variables.
void initialize(MachineFunction &MFParm);

bool eliminateTruncSeq(void);
bool eliminateTruncSeq();

public:

Expand Down Expand Up @@ -452,7 +452,7 @@ void BPFMIPeepholeTruncElim::initialize(MachineFunction &MFParm) {
// are 32-bit registers, but later on, kernel verifier will rewrite
// it with 64-bit value. Therefore, truncating the value after the
// load will result in incorrect code.
bool BPFMIPeepholeTruncElim::eliminateTruncSeq(void) {
bool BPFMIPeepholeTruncElim::eliminateTruncSeq() {
MachineInstr* ToErase = nullptr;
bool Eliminated = false;

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp
Expand Up @@ -55,7 +55,7 @@ struct BPFMISimplifyPatchable : public MachineFunctionPass {
// Initialize class variables.
void initialize(MachineFunction &MFParm);

bool removeLD(void);
bool removeLD();
void processCandidate(MachineRegisterInfo *MRI, MachineBasicBlock &MBB,
MachineInstr &MI, Register &SrcReg, Register &DstReg,
const GlobalValue *GVal, bool IsAma);
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
Expand Up @@ -107,10 +107,10 @@ struct PPCMIPeephole : public MachineFunctionPass {
void initialize(MachineFunction &MFParm);

// Perform peepholes.
bool simplifyCode(void);
bool simplifyCode();

// Perform peepholes.
bool eliminateRedundantCompare(void);
bool eliminateRedundantCompare();
bool eliminateRedundantTOCSaves(std::map<MachineInstr *, bool> &TOCSaves);
bool combineSEXTAndSHL(MachineInstr &MI, MachineInstr *&ToErase);
bool emitRLDICWhenLoweringJumpTables(MachineInstr &MI);
Expand Down Expand Up @@ -381,7 +381,7 @@ static void convertUnprimedAccPHIs(const PPCInstrInfo *TII,
}

// Perform peephole optimizations.
bool PPCMIPeephole::simplifyCode(void) {
bool PPCMIPeephole::simplifyCode() {
bool Simplified = false;
bool TrapOpt = false;
MachineInstr* ToErase = nullptr;
Expand Down Expand Up @@ -1334,7 +1334,7 @@ bool PPCMIPeephole::eliminateRedundantTOCSaves(
// cmpwi r3, 0 ; greather than -1 means greater or equal to 0
// bge 0, .LBB0_4

bool PPCMIPeephole::eliminateRedundantCompare(void) {
bool PPCMIPeephole::eliminateRedundantCompare() {
bool Simplified = false;

for (MachineBasicBlock &MBB2 : *MF) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/SystemZ/SystemZSubtarget.h
Expand Up @@ -85,7 +85,7 @@ class SystemZSubtarget : public SystemZGenSubtargetInfo {

SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
StringRef FS);
SystemZCallingConventionRegisters *initializeSpecialRegisters(void);
SystemZCallingConventionRegisters *initializeSpecialRegisters();

public:
SystemZSubtarget(const Triple &TT, const std::string &CPU,
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/VE/VESubtarget.h
Expand Up @@ -76,7 +76,7 @@ class VESubtarget : public VEGenSubtargetInfo {

/// Get the size of RSA, return address, and frame pointer as described
/// in VEFrameLowering.cpp.
unsigned getRsaSize(void) const { return 176; };
unsigned getRsaSize() const { return 176; };

bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
};
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/X86/X86ISelLowering.h
Expand Up @@ -1540,7 +1540,7 @@ namespace llvm {
unsigned GetAlignedArgumentStackSize(unsigned StackSize,
SelectionDAG &DAG) const;

unsigned getAddressSpace(void) const;
unsigned getAddressSpace() const;

SDValue FP_TO_INTHelper(SDValue Op, SelectionDAG &DAG, bool IsSigned,
SDValue &Chain) const;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp
Expand Up @@ -231,7 +231,7 @@ void VPlanPredicator::linearizeRegionRec(VPRegionBlock *Region) {
}

// Entry point. The driver function for the predicator.
void VPlanPredicator::predicate(void) {
void VPlanPredicator::predicate() {
// Predicate the blocks within Region.
predicateRegionRec(cast<VPRegionBlock>(Plan.getEntry()));

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Vectorize/VPlanPredicator.h
Expand Up @@ -68,7 +68,7 @@ class VPlanPredicator {
VPlanPredicator(VPlan &Plan);

/// Predicate Plan's HCFG.
void predicate(void);
void predicate();
};
} // end namespace llvm
#endif // LLVM_TRANSFORMS_VECTORIZE_VPLAN_PREDICATOR_H
2 changes: 1 addition & 1 deletion llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp
Expand Up @@ -614,7 +614,7 @@ void MachOWriter::writeExportsTrieData() {
}

void MachOWriter::writeTail() {
typedef void (MachOWriter::*WriteHandlerType)(void);
typedef void (MachOWriter::*WriteHandlerType)();
typedef std::pair<uint64_t, WriteHandlerType> WriteOperation;
SmallVector<WriteOperation, 7> Queue;

Expand Down

0 comments on commit 7e163af

Please sign in to comment.