mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Reland #79707
Revert "Merge pull request #80767 from meg-gupta/reverttransparent" This reverts commit198a802719, reversing changes made to8eb43af590.
This commit is contained in:
@@ -938,6 +938,16 @@ static void substituteConstants(FoldState &foldState) {
|
||||
for (SILValue constantSILValue : foldState.getConstantSILValues()) {
|
||||
SymbolicValue constantSymbolicVal =
|
||||
evaluator.lookupConstValue(constantSILValue).value();
|
||||
CanType instType = constantSILValue->getType().getASTType();
|
||||
|
||||
// If the SymbolicValue is a string but the instruction that is folded is
|
||||
// not String typed, we are tracking a StaticString which is represented as
|
||||
// a raw pointer. Skip folding StaticString as they are already efficiently
|
||||
// represented.
|
||||
if (constantSymbolicVal.getKind() == SymbolicValue::String &&
|
||||
!instType->isString())
|
||||
continue;
|
||||
|
||||
// Make sure that the symbolic value tracked in the foldState is a constant.
|
||||
// In the case of ArraySymbolicValue, the array storage could be a non-constant
|
||||
// if some instruction in the array initialization sequence was not evaluated
|
||||
@@ -976,7 +986,6 @@ static void substituteConstants(FoldState &foldState) {
|
||||
|
||||
SILBuilderWithScope builder(insertionPoint);
|
||||
SILLocation loc = insertionPoint->getLoc();
|
||||
CanType instType = constantSILValue->getType().getASTType();
|
||||
SILValue foldedSILVal = emitCodeForSymbolicValue(
|
||||
constantSymbolicVal, instType, builder, loc, foldState.stringInfo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user