Skip to content

Commit 8fd0504

Browse files
committed
[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312971 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 8e66c2e commit 8fd0504

10 files changed

+243
-166
lines changed

include/llvm/CodeGen/MachineSSAUpdater.h

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- MachineSSAUpdater.h - Unstructured SSA Update Tool ------*- C++ -*-===//
1+
//===- MachineSSAUpdater.h - Unstructured SSA Update Tool -------*- C++ -*-===//
22
//
33
// The LLVM Compiler Infrastructure
44
//
@@ -14,18 +14,17 @@
1414
#ifndef LLVM_CODEGEN_MACHINESSAUPDATER_H
1515
#define LLVM_CODEGEN_MACHINESSAUPDATER_H
1616

17-
#include "llvm/Support/Compiler.h"
18-
1917
namespace llvm {
20-
class MachineBasicBlock;
21-
class MachineFunction;
22-
class MachineInstr;
23-
class MachineOperand;
24-
class MachineRegisterInfo;
25-
class TargetInstrInfo;
26-
class TargetRegisterClass;
27-
template<typename T> class SmallVectorImpl;
28-
template<typename T> class SSAUpdaterTraits;
18+
19+
class MachineBasicBlock;
20+
class MachineFunction;
21+
class MachineInstr;
22+
class MachineOperand;
23+
class MachineRegisterInfo;
24+
class TargetInstrInfo;
25+
class TargetRegisterClass;
26+
template<typename T> class SmallVectorImpl;
27+
template<typename T> class SSAUpdaterTraits;
2928

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

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

5352
const TargetInstrInfo *TII;
5453
MachineRegisterInfo *MRI;
54+
5555
public:
5656
/// MachineSSAUpdater constructor. If InsertedPHIs is specified, it will be
5757
/// filled in with all PHI Nodes created by rewriting.
5858
explicit MachineSSAUpdater(MachineFunction &MF,
5959
SmallVectorImpl<MachineInstr*> *InsertedPHIs = nullptr);
60+
MachineSSAUpdater(const MachineSSAUpdater &) = delete;
61+
MachineSSAUpdater &operator=(const MachineSSAUpdater &) = delete;
6062
~MachineSSAUpdater();
6163

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

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

106107
private:
107108
unsigned GetValueAtEndOfBlockInternal(MachineBasicBlock *BB);
108-
109-
void operator=(const MachineSSAUpdater&) = delete;
110-
MachineSSAUpdater(const MachineSSAUpdater&) = delete;
111109
};
112110

113-
} // End llvm namespace
111+
} // end namespace llvm
114112

115-
#endif
113+
#endif // LLVM_CODEGEN_MACHINESSAUPDATER_H

include/llvm/CodeGen/MachineTraceMetrics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@
5252
#include "llvm/ADT/DenseMap.h"
5353
#include "llvm/ADT/None.h"
5454
#include "llvm/ADT/SmallVector.h"
55+
#include "llvm/CodeGen/MachineBasicBlock.h"
5556
#include "llvm/CodeGen/MachineFunctionPass.h"
5657
#include "llvm/CodeGen/TargetSchedule.h"
5758

5859
namespace llvm {
5960

6061
class AnalysisUsage;
61-
class MachineBasicBlock;
6262
class MachineFunction;
6363
class MachineInstr;
6464
class MachineLoop;

0 commit comments

Comments
 (0)