aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-08-31 19:41:03 +0000
committerDevang Patel <dpatel@apple.com>2010-08-31 19:41:03 +0000
commit81b79b5fa808730d102cdc4b60a52e602d425de5 (patch)
treef91e7be5e040bdf5f7cc0295ed7340665e6e8c3c
parentf727748684ccf3b34270a9e5129181359cf675a3 (diff)
downloadexternal_llvm-81b79b5fa808730d102cdc4b60a52e602d425de5.zip
external_llvm-81b79b5fa808730d102cdc4b60a52e602d425de5.tar.gz
external_llvm-81b79b5fa808730d102cdc4b60a52e602d425de5.tar.bz2
Revert r112623. It is causing self host build failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112631 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/FunctionLoweringInfo.h10
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp13
-rw-r--r--lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp23
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp17
-rw-r--r--test/FrontendC++/2010-08-31-ByValArg.cpp53
5 files changed, 4 insertions, 112 deletions
diff --git a/include/llvm/CodeGen/FunctionLoweringInfo.h b/include/llvm/CodeGen/FunctionLoweringInfo.h
index f17fe5a..c49d1ed 100644
--- a/include/llvm/CodeGen/FunctionLoweringInfo.h
+++ b/include/llvm/CodeGen/FunctionLoweringInfo.h
@@ -77,9 +77,6 @@ public:
/// anywhere in the function.
DenseMap<const AllocaInst*, int> StaticAllocaMap;
- /// ByValArgFrameIndexMap - Keep track of frame indices for byval arguments.
- DenseMap<const Argument*, int> ByValArgFrameIndexMap;
-
/// ArgDbgValues - A list of DBG_VALUE instructions created during isel for
/// function arguments that are inserted after scheduling is completed.
SmallVector<MachineInstr*, 8> ArgDbgValues;
@@ -141,13 +138,6 @@ public:
assert(R == 0 && "Already initialized this value register!");
return R = CreateRegs(V->getType());
}
-
- /// setByValArgumentFrameIndex - Record frame index for the byval
- /// argument.
- void setByValArgumentFrameIndex(const Argument *A, int FI);
-
- /// getByValArgumentFrameIndex - Get frame index for the byval argument.
- int getByValArgumentFrameIndex(const Argument *A);
};
/// AddCatchInfo - Extract the personality and type infos from an eh.selector
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index eeae8a3..eaa12d4 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1629,16 +1629,9 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, DbgScope *Scope) {
bool updated = false;
// FIXME : Handle getNumOperands != 3
if (DVInsn->getNumOperands() == 3) {
- if (DVInsn->getOperand(0).isReg()) {
- const MachineOperand RegOp = DVInsn->getOperand(0);
- const TargetRegisterInfo *TRI = Asm->TM.getRegisterInfo();
- if (DVInsn->getOperand(1).isImm() &&
- TRI->getFrameRegister(*Asm->MF) == RegOp.getReg()) {
- addVariableAddress(DV, VariableDie, DVInsn->getOperand(1).getImm());
- updated = true;
- } else
- updated = addRegisterAddress(VariableDie, DVLabel, RegOp);
- }
+ if (DVInsn->getOperand(0).isReg())
+ updated =
+ addRegisterAddress(VariableDie, DVLabel, DVInsn->getOperand(0));
else if (DVInsn->getOperand(0).isImm())
updated = addConstantValue(VariableDie, DVLabel, DVInsn->getOperand(0));
else if (DVInsn->getOperand(0).isFPImm())
diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index bed9c08..77a2c86 100644
--- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -254,29 +254,6 @@ unsigned FunctionLoweringInfo::CreateRegs(const Type *Ty) {
return FirstReg;
}
-/// setByValArgumentFrameIndex - Record frame index for the byval
-/// argument. This overrides previous frame index entry for this argument,
-/// if any.
-void FunctionLoweringInfo::setByValArgumentFrameIndex(const Argument *A,
- int FI) {
- assert (A->hasByValAttr() && "Argument does not have byval attribute!");
- ByValArgFrameIndexMap[A] = FI;
-}
-
-/// getByValArgumentFrameIndex - Get frame index for the byval argument.
-/// This routine must be used after the argument's frame index is set.
-/// If the argument does not have any entry in the map then assertion
-/// will be raised.
-int FunctionLoweringInfo::getByValArgumentFrameIndex(const Argument *A) {
- assert (A->hasByValAttr() && "Argument does not have byval attribute!");
- DenseMap<const Argument *, int>::iterator I =
- ByValArgFrameIndexMap.find(A);
- assert (I != ByValArgFrameIndexMap.end() &&
- "Argument does not have assigned frame index!");
- return I->second;
-
-}
-
/// AddCatchInfo - Extract the personality and type infos from an eh.selector
/// call, and add them to the specified machine basic block.
void llvm::AddCatchInfo(const CallInst &I, MachineModuleInfo *MMI,
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 0a33021..b70bfea 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -3917,8 +3917,7 @@ bool
SelectionDAGBuilder::EmitFuncArgumentDbgValue(const Value *V, MDNode *Variable,
int64_t Offset,
const SDValue &N) {
- const Argument *Arg = dyn_cast<Argument>(V);
- if (!Arg)
+ if (!isa<Argument>(V))
return false;
MachineFunction &MF = DAG.getMachineFunction();
@@ -3932,14 +3931,6 @@ SelectionDAGBuilder::EmitFuncArgumentDbgValue(const Value *V, MDNode *Variable,
return false;
unsigned Reg = 0;
- if (Arg->hasByValAttr()) {
- // Byval arguments' frame index is recorded during argument lowering.
- // Use this info directly.
- const TargetRegisterInfo *TRI = DAG.getTarget().getRegisterInfo();
- Reg = TRI->getFrameRegister(MF);
- Offset = FuncInfo.getByValArgumentFrameIndex(Arg);
- }
-
if (N.getNode() && N.getOpcode() == ISD::CopyFromReg) {
Reg = cast<RegisterSDNode>(N.getOperand(1))->getReg();
if (Reg && TargetRegisterInfo::isVirtualRegister(Reg)) {
@@ -6140,12 +6131,6 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
i += NumParts;
}
- // Note down frame index for byval arguments.
- if (I->hasByValAttr() && !ArgValues.empty())
- if (FrameIndexSDNode *FI =
- dyn_cast<FrameIndexSDNode>(ArgValues[0].getNode()))
- FuncInfo->setByValArgumentFrameIndex(I, FI->getIndex());
-
if (!I->use_empty()) {
SDValue Res;
if (!ArgValues.empty())
diff --git a/test/FrontendC++/2010-08-31-ByValArg.cpp b/test/FrontendC++/2010-08-31-ByValArg.cpp
deleted file mode 100644
index be0d354..0000000
--- a/test/FrontendC++/2010-08-31-ByValArg.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// This regression test checks byval arguments' debug info.
-// Radar 8367011
-// RUN: %llvmgcc -S -O0 -g %s -o - | \
-// RUN: llc --disable-fp-elim -o %t.s -O0 -relocation-model=pic
-// RUN: %compile_c %t.s -o %t.o
-// RUN: %link %t.o -o %t.exe
-// RUN: echo {break get\nrun\np missing_arg.b} > %t.in
-// RUN: gdb -q -batch -n -x %t.in %t.exe | tee %t.out | \
-// RUN: grep {1 = 4242}
-
-// XTARGET: x86_64-apple-darwin
-
-class EVT {
-public:
- int a;
- int b;
- int c;
-};
-
-class VAL {
-public:
- int x;
- int y;
-};
-void foo(EVT e);
-EVT bar();
-
-void get(int *i, unsigned dl, VAL v, VAL *p, unsigned n, EVT missing_arg) {
-//CHECK: .ascii "missing_arg"
- EVT e = bar();
- if (dl == n)
- foo(missing_arg);
-}
-
-
-EVT bar() {
- EVT e;
- return e;
-}
-
-void foo(EVT e) {}
-
-int main(){
- VAL v;
- EVT ma;
- ma.a = 1;
- ma.b = 4242;
- ma.c = 3;
- int i = 42;
- get (&i, 1, v, &v, 2, ma);
- return 0;
-}
-