Skip to content

Commit 2740ad6

Browse files
committed
Temporarily Revert "Add an argument-number field to DebugValueInst and friends."
while investigating buildbot breakage. This reverts commit ed2b16d.
1 parent ed2b16d commit 2740ad6

34 files changed

+271
-295
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,10 @@ class SILBuilder {
219219
// SILInstruction Creation Methods
220220
//===--------------------------------------------------------------------===//
221221

222-
AllocStackInst *createAllocStack(SILLocation Loc, SILType elementType,
223-
unsigned ArgNo = 0) {
222+
AllocStackInst *createAllocStack(SILLocation Loc, SILType elementType) {
224223
Loc.markAsPrologue();
225224
return insert(new (F.getModule()) AllocStackInst(
226-
createSILDebugLocation(Loc), elementType, F, ArgNo));
225+
createSILDebugLocation(Loc), elementType, F));
227226
}
228227

229228
AllocRefInst *createAllocRef(SILLocation Loc, SILType elementType, bool objc,
@@ -250,11 +249,10 @@ class SILBuilder {
250249
createSILDebugLocation(Loc), valueType, operand));
251250
}
252251

253-
AllocBoxInst *createAllocBox(SILLocation Loc, SILType ElementType,
254-
unsigned ArgNo = 0) {
252+
AllocBoxInst *createAllocBox(SILLocation Loc, SILType ElementType) {
255253
Loc.markAsPrologue();
256254
return insert(new (F.getModule()) AllocBoxInst(createSILDebugLocation(Loc),
257-
ElementType, F, ArgNo));
255+
ElementType, F));
258256
}
259257

260258
AllocExistentialBoxInst *
@@ -433,16 +431,13 @@ class SILBuilder {
433431
return insert(
434432
MarkFunctionEscapeInst::create(createSILDebugLocation(Loc), vars, F));
435433
}
436-
437-
DebugValueInst *createDebugValue(SILLocation Loc, SILValue src,
438-
unsigned ArgNo = 0) {
434+
DebugValueInst *createDebugValue(SILLocation Loc, SILValue src) {
439435
return insert(new (F.getModule())
440-
DebugValueInst(createSILDebugLocation(Loc), src, ArgNo));
436+
DebugValueInst(createSILDebugLocation(Loc), src));
441437
}
442-
DebugValueAddrInst *createDebugValueAddr(SILLocation Loc, SILValue src,
443-
unsigned ArgNo = 0) {
444-
return insert(new (F.getModule()) DebugValueAddrInst(
445-
createSILDebugLocation(Loc), src, ArgNo));
438+
DebugValueAddrInst *createDebugValueAddr(SILLocation Loc, SILValue src) {
439+
return insert(new (F.getModule())
440+
DebugValueAddrInst(createSILDebugLocation(Loc), src));
446441
}
447442

448443
LoadWeakInst *createLoadWeak(SILLocation Loc, SILValue src, IsTake_t isTake) {

include/swift/SIL/SILCloner.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -670,9 +670,9 @@ SILCloner<ImplClass>::visitDebugValueInst(DebugValueInst *Inst) {
670670

671671
// Since we want the debug info to survive, we do not remap the location here.
672672
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
673-
doPostProcess(Inst, getBuilder().createDebugValue(
674-
Inst->getLoc(), getOpValue(Inst->getOperand()),
675-
Inst->getVarInfo().getArgNo()));
673+
doPostProcess(Inst,
674+
getBuilder().createDebugValue(Inst->getLoc(),
675+
getOpValue(Inst->getOperand())));
676676
}
677677
template<typename ImplClass>
678678
void
@@ -686,9 +686,9 @@ SILCloner<ImplClass>::visitDebugValueAddrInst(DebugValueAddrInst *Inst) {
686686
// Do not remap the location for a debug Instruction.
687687
SILValue OpValue = getOpValue(Inst->getOperand());
688688
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
689-
doPostProcess(
690-
Inst, getBuilder().createDebugValueAddr(Inst->getLoc(), OpValue,
691-
Inst->getVarInfo().getArgNo()));
689+
doPostProcess(Inst,
690+
getBuilder().createDebugValueAddr(Inst->getLoc(),
691+
OpValue));
692692
}
693693

694694

include/swift/SIL/SILInstruction.h

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -316,27 +316,14 @@ class UnaryInstructionBase : public BASE {
316316
typename std::enable_if<has_result<X>::value, SILType>::type
317317
getType(unsigned i = 0) const { return ValueBase::getType(i); }
318318

319-
ArrayRef<Operand> getAllOperands() const { return Operands.asArray(); }\
319+
ArrayRef<Operand> getAllOperands() const { return Operands.asArray(); }
320320
MutableArrayRef<Operand> getAllOperands() { return Operands.asArray(); }
321321

322322
static bool classof(const ValueBase *V) {
323323
return V->getKind() == KIND;
324324
}
325325
};
326326

327-
328-
/// Holds common debug information about local variables and function
329-
/// arguments that are needed by DebugValueInst, DebugValueAddrInst,
330-
/// AllocStackInst, and AllocBoxInst.
331-
class DebugVariable {
332-
/// The source function argument position from left to right
333-
/// starting with 1 or 0 if this is a local variable.
334-
unsigned char ArgNo;
335-
public:
336-
DebugVariable(unsigned ArgNo) : ArgNo(ArgNo) {};
337-
unsigned getArgNo() const { return ArgNo; }
338-
};
339-
340327
//===----------------------------------------------------------------------===//
341328
// Allocation Instructions
342329
//===----------------------------------------------------------------------===//
@@ -381,20 +368,15 @@ class StackPromotable {
381368
/// reference count) stack memory. The memory is provided uninitialized.
382369
class AllocStackInst : public AllocationInst {
383370
friend class SILBuilder;
384-
DebugVariable VarInfo;
385371

386-
AllocStackInst(SILDebugLocation *Loc, SILType elementType, SILFunction &F,
387-
unsigned ArgNo);
372+
AllocStackInst(SILDebugLocation *Loc, SILType elementType, SILFunction &F);
388373

389374
public:
390375

391376
/// getDecl - Return the underlying variable declaration associated with this
392377
/// allocation, or null if this is a temporary allocation.
393378
VarDecl *getDecl() const;
394379

395-
DebugVariable getVarInfo() const { return VarInfo; };
396-
void setArgNo(unsigned N) { VarInfo = DebugVariable(N); }
397-
398380
/// getElementType - Get the type of the allocated memory (as opposed to the
399381
/// (second) type of the instruction itself, which will be an address type).
400382
SILType getElementType() const {
@@ -481,10 +463,7 @@ class AllocValueBufferInst :
481463
class AllocBoxInst : public AllocationInst {
482464
friend class SILBuilder;
483465

484-
DebugVariable VarInfo;
485-
486-
AllocBoxInst(SILDebugLocation *DebugLoc, SILType ElementType, SILFunction &F,
487-
unsigned ArgNo);
466+
AllocBoxInst(SILDebugLocation *DebugLoc, SILType ElementType, SILFunction &F);
488467

489468
public:
490469

@@ -499,8 +478,6 @@ class AllocBoxInst : public AllocationInst {
499478
/// allocation, or null if this is a temporary allocation.
500479
VarDecl *getDecl() const;
501480

502-
DebugVariable getVarInfo() const { return VarInfo; };
503-
504481
ArrayRef<Operand> getAllOperands() const { return {}; }
505482
MutableArrayRef<Operand> getAllOperands() { return {}; }
506483

@@ -1364,34 +1341,29 @@ class MarkFunctionEscapeInst : public SILInstruction {
13641341
/// types).
13651342
class DebugValueInst : public UnaryInstructionBase<ValueKind::DebugValueInst> {
13661343
friend class SILBuilder;
1367-
DebugVariable VarInfo;
13681344

1369-
DebugValueInst(SILDebugLocation *DebugLoc, SILValue Operand, unsigned ArgNo)
1370-
: UnaryInstructionBase(DebugLoc, Operand), VarInfo(ArgNo) {}
1345+
DebugValueInst(SILDebugLocation *DebugLoc, SILValue Operand)
1346+
: UnaryInstructionBase(DebugLoc, Operand) {}
13711347

13721348
public:
13731349
/// getDecl - Return the underlying variable declaration that this denotes,
13741350
/// or null if we don't have one.
13751351
VarDecl *getDecl() const;
1376-
DebugVariable getVarInfo() const { return VarInfo; }
13771352
};
13781353

13791354
/// Define the start or update to a symbolic variable value (for address-only
13801355
/// types) .
13811356
class DebugValueAddrInst
13821357
: public UnaryInstructionBase<ValueKind::DebugValueAddrInst> {
13831358
friend class SILBuilder;
1384-
DebugVariable VarInfo;
13851359

1386-
DebugValueAddrInst(SILDebugLocation *DebugLoc, SILValue Operand,
1387-
unsigned ArgNo)
1388-
: UnaryInstructionBase(DebugLoc, Operand), VarInfo(ArgNo) {}
1360+
DebugValueAddrInst(SILDebugLocation *DebugLoc, SILValue Operand)
1361+
: UnaryInstructionBase(DebugLoc, Operand) {}
13891362

13901363
public:
13911364
/// getDecl - Return the underlying variable declaration that this denotes,
13921365
/// or null if we don't have one.
13931366
VarDecl *getDecl() const;
1394-
DebugVariable getVarInfo() const { return VarInfo; }
13951367
};
13961368

13971369

lib/IRGen/DebugTypeInfo.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ namespace swift {
7171
if (ValueDecl *D = getDecl()) return D->getDeclContext();
7272
else return DeclOrContext.get<DeclContext*>();
7373
}
74-
75-
void unwrapInOutType() {
76-
Type = Type->castTo<InOutType>()->getObjectType().getPointer();
77-
}
78-
7974
bool isNull() const { return Type == nullptr; }
8075
bool operator==(DebugTypeInfo T) const;
8176
bool operator!=(DebugTypeInfo T) const;

0 commit comments

Comments
 (0)