mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Mangling: wire up the new mangling in various places in the compiler, but still use the old mangling.
The purpose of this change is to test if the new mangling is equivalent to the old mangling. Both mangling strings are created, de-mangled and checked if the de-mangle trees are equivalent.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "swift/SILOptimizer/PassManager/Passes.h"
|
||||
#include "swift/SIL/Dominance.h"
|
||||
#include "swift/SIL/Mangle.h"
|
||||
#include "swift/SILOptimizer/Utils/SpecializationMangler.h"
|
||||
#include "swift/SIL/SILArgument.h"
|
||||
#include "swift/SIL/SILBuilder.h"
|
||||
#include "swift/SIL/SILCloner.h"
|
||||
@@ -521,11 +522,16 @@ static std::string getClonedName(SILFunction *F,
|
||||
ParamIndexList &PromotedParamIndices) {
|
||||
Mangle::Mangler M;
|
||||
auto P = SpecializationPass::AllocBoxToStack;
|
||||
FunctionSignatureSpecializationMangler FSSM(P, M, Fragile, F);
|
||||
for (unsigned i : PromotedParamIndices)
|
||||
FSSM.setArgumentBoxToStack(i);
|
||||
FSSM.mangle();
|
||||
return M.finalize();
|
||||
FunctionSignatureSpecializationMangler OldFSSM(P, M, Fragile, F);
|
||||
NewMangling::FunctionSignatureSpecializationMangler NewFSSM(P, Fragile, F);
|
||||
for (unsigned i : PromotedParamIndices) {
|
||||
OldFSSM.setArgumentBoxToStack(i);
|
||||
NewFSSM.setArgumentBoxToStack(i);
|
||||
}
|
||||
OldFSSM.mangle();
|
||||
std::string Old = M.finalize();
|
||||
std::string New = NewFSSM.mangle();
|
||||
return NewMangling::selectMangling(Old, New);
|
||||
}
|
||||
|
||||
/// \brief Create the function corresponding to the clone of the
|
||||
|
||||
Reference in New Issue
Block a user