Skip to content

Commit

Permalink
[CodeGen] Fix some Clang-tidy modernize-use-using and Include What Yo…
Browse files Browse the repository at this point in the history
…u Use warnings; other minor fixes (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312971 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
EugeneZelenko committed Sep 11, 2017
1 parent 8e66c2e commit 8fd0504
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 166 deletions.
36 changes: 17 additions & 19 deletions include/llvm/CodeGen/MachineSSAUpdater.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- MachineSSAUpdater.h - Unstructured SSA Update Tool ------*- C++ -*-===//
//===- MachineSSAUpdater.h - Unstructured SSA Update Tool -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
Expand All @@ -14,18 +14,17 @@
#ifndef LLVM_CODEGEN_MACHINESSAUPDATER_H
#define LLVM_CODEGEN_MACHINESSAUPDATER_H

#include "llvm/Support/Compiler.h"

namespace llvm {
class MachineBasicBlock;
class MachineFunction;
class MachineInstr;
class MachineOperand;
class MachineRegisterInfo;
class TargetInstrInfo;
class TargetRegisterClass;
template<typename T> class SmallVectorImpl;
template<typename T> class SSAUpdaterTraits;

class MachineBasicBlock;
class MachineFunction;
class MachineInstr;
class MachineOperand;
class MachineRegisterInfo;
class TargetInstrInfo;
class TargetRegisterClass;
template<typename T> class SmallVectorImpl;
template<typename T> class SSAUpdaterTraits;

/// MachineSSAUpdater - This class updates SSA form for a set of virtual
/// registers defined in multiple blocks. This is used when code duplication
Expand All @@ -38,7 +37,7 @@ class MachineSSAUpdater {
/// AvailableVals - This keeps track of which value to use on a per-block
/// basis. When we insert PHI nodes, we keep track of them here.
//typedef DenseMap<MachineBasicBlock*, unsigned > AvailableValsTy;
void *AV;
void *AV = nullptr;

/// VR - Current virtual register whose uses are being updated.
unsigned VR;
Expand All @@ -52,11 +51,14 @@ class MachineSSAUpdater {

const TargetInstrInfo *TII;
MachineRegisterInfo *MRI;

public:
/// MachineSSAUpdater constructor. If InsertedPHIs is specified, it will be
/// filled in with all PHI Nodes created by rewriting.
explicit MachineSSAUpdater(MachineFunction &MF,
SmallVectorImpl<MachineInstr*> *InsertedPHIs = nullptr);
MachineSSAUpdater(const MachineSSAUpdater &) = delete;
MachineSSAUpdater &operator=(const MachineSSAUpdater &) = delete;
~MachineSSAUpdater();

/// Initialize - Reset this object to get ready for a new set of SSA
Expand Down Expand Up @@ -93,7 +95,6 @@ class MachineSSAUpdater {
/// their respective blocks. However, the use of X happens in the *middle* of
/// a block. Because of this, we need to insert a new PHI node in SomeBB to
/// merge the appropriate values, and this value isn't live out of the block.
///
unsigned GetValueInMiddleOfBlock(MachineBasicBlock *BB);

/// RewriteUse - Rewrite a use of the symbolic value. This handles PHI nodes,
Expand All @@ -105,11 +106,8 @@ class MachineSSAUpdater {

private:
unsigned GetValueAtEndOfBlockInternal(MachineBasicBlock *BB);

void operator=(const MachineSSAUpdater&) = delete;
MachineSSAUpdater(const MachineSSAUpdater&) = delete;
};

} // End llvm namespace
} // end namespace llvm

#endif
#endif // LLVM_CODEGEN_MACHINESSAUPDATER_H
2 changes: 1 addition & 1 deletion include/llvm/CodeGen/MachineTraceMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/TargetSchedule.h"

namespace llvm {

class AnalysisUsage;
class MachineBasicBlock;
class MachineFunction;
class MachineInstr;
class MachineLoop;
Expand Down
Loading

0 comments on commit 8fd0504

Please sign in to comment.