@@ -1637,7 +1637,7 @@ bool LinkInfo::isUsed(IRLinkage IRL) {
1637
1637
llvm::GlobalVariable *swift::irgen::createVariable (
1638
1638
IRGenModule &IGM, LinkInfo &linkInfo, llvm::Type *storageType,
1639
1639
Alignment alignment, DebugTypeInfo DbgTy, Optional<SILLocation> DebugLoc,
1640
- StringRef DebugName, bool inFixedBuffer, bool indirectForDebugInfo ) {
1640
+ StringRef DebugName, bool inFixedBuffer) {
1641
1641
auto name = linkInfo.getName ();
1642
1642
llvm::GlobalValue *existingValue = IGM.Module .getNamedGlobal (name);
1643
1643
if (existingValue) {
@@ -1671,7 +1671,7 @@ llvm::GlobalVariable *swift::irgen::createVariable(
1671
1671
if (IGM.DebugInfo && !DbgTy.isNull () && linkInfo.isForDefinition ())
1672
1672
IGM.DebugInfo ->emitGlobalVariableDeclaration (
1673
1673
var, DebugName.empty () ? name : DebugName, name, DbgTy,
1674
- var->hasInternalLinkage (), indirectForDebugInfo , DebugLoc);
1674
+ var->hasInternalLinkage (), inFixedBuffer , DebugLoc);
1675
1675
1676
1676
return var;
1677
1677
}
@@ -1809,13 +1809,6 @@ Address IRGenModule::getAddrOfSILGlobalVariable(SILGlobalVariable *var,
1809
1809
Size fixedSize;
1810
1810
Alignment fixedAlignment;
1811
1811
bool inFixedBuffer = false ;
1812
- bool indirectForDebugInfo = false ;
1813
-
1814
- // FIXME: Remove this once LLDB has proper support for resilience.
1815
- bool isREPLVar = false ;
1816
- if (auto *decl = var->getDecl ())
1817
- if (decl->isREPLVar ())
1818
- isREPLVar = true ;
1819
1812
1820
1813
if (var->isInitializedObject ()) {
1821
1814
assert (ti.isFixedSize (expansion));
@@ -1837,7 +1830,7 @@ Address IRGenModule::getAddrOfSILGlobalVariable(SILGlobalVariable *var,
1837
1830
fixedAlignment = Layout->getAlignment ();
1838
1831
castStorageToType = cast<FixedTypeInfo>(ti).getStorageType ();
1839
1832
assert (fixedAlignment >= TargetInfo.HeapObjectAlignment );
1840
- } else if (isREPLVar || ti.isFixedSize (expansion)) {
1833
+ } else if (ti.isFixedSize (expansion)) {
1841
1834
// Allocate static storage.
1842
1835
auto &fixedTI = cast<FixedTypeInfo>(ti);
1843
1836
storageType = fixedTI.getStorageType ();
@@ -1850,28 +1843,6 @@ Address IRGenModule::getAddrOfSILGlobalVariable(SILGlobalVariable *var,
1850
1843
storageType = getFixedBufferTy ();
1851
1844
fixedSize = Size (DataLayout.getTypeAllocSize (storageType));
1852
1845
fixedAlignment = Alignment (DataLayout.getABITypeAlignment (storageType));
1853
-
1854
- // DebugInfo is not resilient for now, so disable resilience to figure out
1855
- // if lldb needs to dereference the global variable or not.
1856
- //
1857
- // FIXME: Once lldb can make use of remote mirrors to calculate layouts
1858
- // at runtime, this should be removed.
1859
- {
1860
- LoweringModeScope Scope (*this , TypeConverter::Mode::CompletelyFragile);
1861
-
1862
- SILType loweredTy = var->getLoweredType ();
1863
- auto &nonResilientTI = cast<FixedTypeInfo>(getTypeInfo (loweredTy));
1864
- auto packing = nonResilientTI.getFixedPacking (*this );
1865
- switch (packing) {
1866
- case FixedPacking::OffsetZero:
1867
- break ;
1868
- case FixedPacking::Allocate:
1869
- indirectForDebugInfo = true ;
1870
- break ;
1871
- default :
1872
- llvm_unreachable (" Bad packing" );
1873
- }
1874
- }
1875
1846
}
1876
1847
1877
1848
// Check whether we've created the global variable already.
@@ -1913,8 +1884,7 @@ Address IRGenModule::getAddrOfSILGlobalVariable(SILGlobalVariable *var,
1913
1884
auto DbgTy = DebugTypeInfo::getGlobal (var, storageTypeWithContainer,
1914
1885
fixedSize, fixedAlignment);
1915
1886
gvar = createVariable (*this , link , storageTypeWithContainer,
1916
- fixedAlignment, DbgTy, loc, name, inFixedBuffer,
1917
- indirectForDebugInfo);
1887
+ fixedAlignment, DbgTy, loc, name, inFixedBuffer);
1918
1888
}
1919
1889
// / Add a zero initializer.
1920
1890
if (forDefinition)
0 commit comments