@@ -70,13 +70,6 @@ void SymbolicValue::print(llvm::raw_ostream &os, unsigned indent) const {
70
70
case RK_String:
71
71
os << " string: \" " << getStringValue () << " \"\n " ;
72
72
return ;
73
- case RK_Address: {
74
- os << " address indices = [" ;
75
- interleave (getAddressIndices (), [&](unsigned idx) { os << idx; },
76
- [&]() { os << " , " ; });
77
- os << " ]: " << getAddressBase ();
78
- return ;
79
- }
80
73
case RK_Aggregate: {
81
74
ArrayRef<SymbolicValue> elements = getAggregateValue ();
82
75
if (elements.empty ()) {
@@ -109,7 +102,6 @@ SymbolicValue::Kind SymbolicValue::getKind() const {
109
102
case RK_Unknown: return Unknown;
110
103
case RK_Metatype: return Metatype;
111
104
case RK_Function: return Function;
112
- case RK_Address: return Address;
113
105
case RK_Aggregate: return Aggregate;
114
106
case RK_Integer: return Integer;
115
107
case RK_Float: return Float;
@@ -336,74 +328,6 @@ StringRef SymbolicValue::getStringValue() const {
336
328
return cast<StringLiteralInst>(value.inst )->getValue ();
337
329
}
338
330
339
- // ===----------------------------------------------------------------------===//
340
- // Addresses
341
- // ===----------------------------------------------------------------------===//
342
-
343
- namespace swift {
344
- // / This is a representation of an address value, stored as a base pointer plus
345
- // / trailing array of indices. Elements of this value are bump-pointer
346
- // / allocated.
347
- struct alignas (SILValue) AddressSymbolicValue final
348
- : private llvm::TrailingObjects<AddressSymbolicValue, unsigned > {
349
- friend class llvm ::TrailingObjects<AddressSymbolicValue, unsigned >;
350
-
351
- // / The number of words in the trailing array and # bits of the value.
352
- const SILValue base;
353
- const unsigned numIndices;
354
-
355
- static AddressSymbolicValue *create (SILValue base, ArrayRef<unsigned > indices,
356
- llvm::BumpPtrAllocator &allocator) {
357
- auto byteSize =
358
- AddressSymbolicValue::totalSizeToAlloc<unsigned >(indices.size ());
359
- auto rawMem = allocator.Allocate (byteSize, alignof (AddressSymbolicValue));
360
-
361
- // Placement initialize the AddressSymbolicValue.
362
- auto alv = ::new (rawMem) AddressSymbolicValue (base, indices.size ());
363
- std::uninitialized_copy (indices.begin (), indices.end (),
364
- alv->getTrailingObjects <unsigned >());
365
- return alv;
366
- }
367
-
368
- ArrayRef<unsigned > getIndices () const {
369
- return { getTrailingObjects<unsigned >(), numIndices };
370
- }
371
-
372
- // This is used by the llvm::TrailingObjects base class.
373
- size_t numTrailingObjects (OverloadToken<unsigned >) const {
374
- return numIndices;
375
- }
376
- private:
377
- AddressSymbolicValue () = delete ;
378
- AddressSymbolicValue (const AddressSymbolicValue &) = delete ;
379
- AddressSymbolicValue (SILValue base, unsigned numIndices)
380
- : base (base), numIndices (numIndices) {}
381
- };
382
- } // end namespace swift
383
-
384
-
385
- SymbolicValue
386
- SymbolicValue::getAddress (SILValue base, ArrayRef<unsigned > indices,
387
- llvm::BumpPtrAllocator &allocator) {
388
- auto alv = AddressSymbolicValue::create (base, indices, allocator);
389
- assert (alv && " aggregate value must be present" );
390
- SymbolicValue result;
391
- result.representationKind = RK_Address;
392
- result.value .address = alv;
393
- return result;
394
- }
395
-
396
- SILValue SymbolicValue::getAddressBase () const {
397
- assert (representationKind == RK_Address);
398
- return value.address ->base ;
399
- }
400
-
401
- ArrayRef<unsigned > SymbolicValue::getAddressIndices () const {
402
- assert (representationKind == RK_Address);
403
- return value.address ->getIndices ();
404
- }
405
-
406
-
407
331
// ===----------------------------------------------------------------------===//
408
332
// Aggregates
409
333
// ===----------------------------------------------------------------------===//
0 commit comments