[PATCH] D16873: Refactor MemRegionManager::getVarRegion to call two new functions, improving readability

Devin Coughlin via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 7 21:25:16 PST 2016


dcoughlin added a comment.

I think Aleksei is right and I was wrong.

If you follow his advice and move the call to getStackOrCaptureRegionForDeclContext() to getVarRegion() and then pass the StackFrameContext to what you currently name "getMemRegionStaticLocal" then both methods have the very nice property that they return memory space regions and all the VarRegion stuff is kept in the caller.

In my opinion `getMemSpaceForGlobalVariable()` and `getMemSpaceForLocalVariable()` are good names for these two new methods. If you prefer 'getMemSpaceForStaticLocalOrLocalVariable()' I think that would be fine too.


http://reviews.llvm.org/D16873





More information about the cfe-commits mailing list