aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-02-10 00:41:49 +0000
committerDale Johannesen <dalej@apple.com>2010-02-10 00:41:49 +0000
commit9653f9ec970147a12216d787078eab2f8b9c122a (patch)
treeb49955fb580d864d121d0f9c02172623b8f4c0bf
parent8e089a9e4d6b7aa2b3968c38644f926f60a7c670 (diff)
Add isDebug argument to ChangeToRegister; this prevents
the field from being used uninitialized later in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95735 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/MachineOperand.h2
-rw-r--r--lib/CodeGen/MachineInstr.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h
index 72f8775a26..0bb6d7d3b5 100644
--- a/include/llvm/CodeGen/MachineOperand.h
+++ b/include/llvm/CodeGen/MachineOperand.h
@@ -379,7 +379,7 @@ public:
/// the setReg method should be used.
void ChangeToRegister(unsigned Reg, bool isDef, bool isImp = false,
bool isKill = false, bool isDead = false,
- bool isUndef = false);
+ bool isUndef = false, bool isDebug = false);
//===--------------------------------------------------------------------===//
// Construction methods.
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 12d30065b8..34f7781866 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -127,7 +127,8 @@ void MachineOperand::ChangeToImmediate(int64_t ImmVal) {
/// the specified value. If an operand is known to be an register already,
/// the setReg method should be used.
void MachineOperand::ChangeToRegister(unsigned Reg, bool isDef, bool isImp,
- bool isKill, bool isDead, bool isUndef) {
+ bool isKill, bool isDead, bool isUndef,
+ bool isDebug) {
// If this operand is already a register operand, use setReg to update the
// register's use/def lists.
if (isReg()) {
@@ -152,6 +153,7 @@ void MachineOperand::ChangeToRegister(unsigned Reg, bool isDef, bool isImp,
IsDead = isDead;
IsUndef = isUndef;
IsEarlyClobber = false;
+ IsDebug = isDebug;
SubReg = 0;
}