diff options
author | Pat Gavlin <pagavlin@microsoft.com> | 2017-01-06 14:12:35 -0800 |
---|---|---|
committer | Pat Gavlin <pagavlin@microsoft.com> | 2017-01-06 14:12:35 -0800 |
commit | a5bfd0769ec7cce40c2c5717663b34e2059d75a8 (patch) | |
tree | 39f391d338eea1d3426c2d4309762d8cbd9cd9eb /src | |
parent | 583733b399edb423719e4754a3184913495e7575 (diff) | |
download | coreclr-a5bfd0769ec7cce40c2c5717663b34e2059d75a8.tar.gz coreclr-a5bfd0769ec7cce40c2c5717663b34e2059d75a8.tar.bz2 coreclr-a5bfd0769ec7cce40c2c5717663b34e2059d75a8.zip |
Simplify lclNum fetching and a few assertions.
Diffstat (limited to 'src')
-rw-r--r-- | src/jit/liveness.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/jit/liveness.cpp b/src/jit/liveness.cpp index 1b19785375..b73a9fad87 100644 --- a/src/jit/liveness.cpp +++ b/src/jit/liveness.cpp @@ -22,19 +22,12 @@ */ void Compiler::fgMarkUseDef(GenTreeLclVarCommon* tree) { - unsigned lclNum; - if (tree->gtOper == GT_LCL_VAR || tree->gtOper == GT_LCL_VAR_ADDR || tree->gtOper == GT_STORE_LCL_VAR) - { - lclNum = tree->gtLclNum; - } - else - { - assert(tree->OperIsLocalField()); - lclNum = tree->gtLclFld.gtLclNum; - } + assert((tree->OperIsLocal() && (tree->OperGet() != GT_PHI_ARG)) || tree->OperIsLocalAddr()); + const unsigned lclNum = tree->gtLclNum; assert(lclNum < lvaCount); - LclVarDsc* const varDsc = lvaTable + lclNum; + + LclVarDsc* const varDsc = &lvaTable[lclNum]; // We should never encounter a reference to a lclVar that has a zero refCnt. if (varDsc->lvRefCnt == 0 && (!varTypeIsPromotable(varDsc) || !varDsc->lvPromoted)) |