[PATCH] [PowerPC] Fix unwind info with dynamic stack realignment

Will Schmidt willschm at us.ibm.com
Wed Nov 26 08:00:10 PST 2014


================
Comment at: lib/Target/PowerPC/PPCFrameLowering.cpp:737
@@ +736,3 @@
+      // terms of BP, because it's not at a fixed offset from SP.
+      // Otherwise, we could define it in terms of either BP or SP, but BP is
+      // easier because the offset is always zero.
----------------
foad wrote:
> willschm wrote:
> > s/Otherwise, we/We/
> The "otherwise" is there for a reason: we only get to choose between BP and SP if there has *not* been any dynamic stack realignment. I'm open to ideas for rewording the whole thing it it'll make it easier to understand.
Ok, yeah, so partly due to the location of the comment, i misinterpreted the intent of 'otherwise'  :-)   How about pulling the comment out of the if statement, and adding a hint for the (HasBP) if/otherwise like so ? 


```
	​ // If the stack has been dynamically realigned (HasBP) then we must define CFA in
	​ // terms of BP, because it's not at a fixed offset from SP.
	​ // Otherwise, we could define the CFA in terms of either BP or SP, but BP is
	​ // easier because the offset is always zero.
	​ if (HasBP) {

```

http://reviews.llvm.org/D6410






More information about the llvm-commits mailing list