Here is the call stack when hitting the function lib/IRGen/EnumPayload.cpp:530 (EnumPayload::emitCompare)
.
Breakpoint 1, swift::irgen::EnumPayload::emitCompare (this=0x3ffffff5c78, IGF=..., mask=..., value=...)
at /home/work/sw/swift42/swift/lib/IRGen/EnumPayload.cpp:564
564 bool isMasked = !maskPiece.isAllOnesValue();
(gdb) bt
#0 swift::irgen::EnumPayload::emitCompare (this=0x3ffffff5c78, IGF=..., mask=..., value=...)
at /home/work/sw/swift42/swift/lib/IRGen/EnumPayload.cpp:564
#1 0x00000000805ad8c8 in swift::irgen::EnumPayload::emitSwitch (this=0x3ffffff5c78, IGF=..., mask=..., cases=...,
dflt=...) at /home/work/sw/swift42/swift/lib/IRGen/EnumPayload.cpp:519
#2 0x00000000802bc996 in (anonymous namespace)::SinglePayloadEnumImplStrategy::emitValueSwitch (this=0x8b711340,
IGF=..., value=..., dests=..., defaultDest=0x8b87e070) at /home/work/sw/swift42/swift/lib/IRGen/GenEnum.cpp:1948
#3 0x00000000804b7bc0 in (anonymous namespace)::IRGenSILFunction::visitSwitchEnumInst (this=0x3ffffff6af0,
inst=0x8af2dac0) at /home/work/sw/swift42/swift/lib/IRGen/IRGenSIL.cpp:2933
#4 0x00000000804a872e in swift::SILInstructionVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit (
this=0x3ffffff6af0, inst=0x8af2dac0) at /home/work/sw/swift42/swift/include/swift/SIL/SILNodes.def:525
#5 0x00000000804a014a in (anonymous namespace)::IRGenSILFunction::visitSILBasicBlock (this=0x3ffffff6af0,
BB=0x8aee4740) at /home/work/sw/swift42/swift/lib/IRGen/IRGenSIL.cpp:1830
#6 0x000000008049be24 in (anonymous namespace)::IRGenSILFunction::emitSILFunction (this=0x3ffffff6af0)
at /home/work/sw/swift42/swift/lib/IRGen/IRGenSIL.cpp:1696
#7 0x000000008049b2ea in swift::irgen::IRGenModule::emitSILFunction (this=0x3ffffff7998, f=0x8b752410)
at /home/work/sw/swift42/swift/lib/IRGen/IRGenSIL.cpp:1612
#8 0x00000000802488f0 in swift::irgen::IRGenerator::emitGlobalTopLevel (this=0x3ffffff90c8,
emitForParallelEmission=false) at /home/work/sw/swift42/swift/lib/IRGen/GenDecl.cpp:1080
#9 0x000000008041d214 in performIRGeneration (Opts=..., M=0x8ae186b0, SILMod=..., ModuleName=..., PSPs=...,
LLVMContext=..., SF=0x0, outModuleHash=0x0, StartElem=0) at /home/work/sw/swift42/swift/lib/IRGen/IRGen.cpp:752
#10 0x000000008041bee2 in swift::performIRGeneration (Opts=..., M=0x8ae186b0, SILMod=..., ModuleName=..., PSPs=...,
LLVMContext=..., parallelOutputFilenames=..., outModuleHash=0x0)
at /home/work/sw/swift42/swift/lib/IRGen/IRGen.cpp:1074
#11 0x000000008021f76a in swift::RunImmediately (CI=..., CmdLine=..., IRGenOpts=..., SILOpts=...)
at /home/work/sw/swift42/swift/lib/Immediate/Immediate.cpp:301
#12 0x00000000801c945e in processCommandLineAndRunImmediately (Invocation=..., Instance=..., SM=..., MSF=...,
observer=0x0, ReturnValue=@0x3ffffffb5f4: 0) at /home/work/sw/swift42/swift/lib/FrontendTool/FrontendTool.cpp:1129
#13 0x00000000801c48ec in performCompileStepsPostSILGen (Instance=..., Invocation=..., SM=...,
astGuaranteedToCorrespondToSIL=true, MSF=..., PSPs=..., moduleIsPublic=false, ReturnValue=@0x3ffffffb5f4: 0,
observer=0x0, Stats=0x0) at /home/work/sw/swift42/swift/lib/FrontendTool/FrontendTool.cpp:1315
#14 0x00000000801bee7c in performCompile (Instance=..., Invocation=..., Args=..., ReturnValue=@0x3ffffffb5f4: 0,
observer=0x0, Stats=0x0) at /home/work/sw/swift42/swift/lib/FrontendTool/FrontendTool.cpp:975
#15 0x00000000801bdb04 in swift::performFrontend (Args=..., Argv0=0x3fffffff71f "/home/work/sw_42/usr/bin/swift",
MainAddr=0x800d9c74 <getExecutablePath[abi:cxx11](char const*)>, observer=0x0)
at /home/work/sw/swift42/swift/lib/FrontendTool/FrontendTool.cpp:1789
#16 0x00000000800dbade in run_driver (ExecName=..., argv=...)
at /home/work/sw/swift42/swift/tools/driver/driver.cpp:121
#17 0x00000000800dab2c in main (argc_=9, argv_=0x3fffffff4a8)
at /home/work/sw/swift42/swift/tools/driver/driver.cpp:248
We checked the calling functions of each layer, but did not find the difference between the 1st and 2nd time calling.
Seems that the while statement in /lib/IRGen/IRGenSIL.cpp:1692
invokes the calling.
But how do we find the difference of the 2 time calls?
Thanks,