[PATCH] [stack protector] Improved data layout rules, part 4

Bill Wendling isanbard at gmail.com
Fri Jan 31 14:08:24 PST 2014


  See comments inline.


================
Comment at: docs/LangRef.rst:1064
@@ +1063,3 @@
+    The specific layout rules are:
+    - Large arrays and structures containing large arrays (>= ssp-buffer-size)
+      are closest to the stack protector.
----------------
Please use a monospaced font for '>= ssp-buffer-size'. here and elsewhere.

================
Comment at: docs/LangRef.rst:1069
@@ +1068,3 @@
+    - Variables that have had their address taken are 3rd closest to the
+      protector.
+
----------------
If these are order of how it's determined where an array goes, please number the list.

================
Comment at: lib/CodeGen/LocalStackSlotAllocation.cpp:198
@@ -197,1 +197,3 @@
+                SmallArrayObjs,
+                AddrOfObjs;
     AdjustStackOffset(MFI, MFI->getStackProtectorIndex(), Offset,
----------------
Please use one variable per declaration line:

StackObjSet LargeArrayObjs;
StackObjSet SmallArrayObjs;
StackObjSet AddrOfObjs;

================
Comment at: lib/CodeGen/PrologEpilogInserter.cpp:557
@@ -556,1 +556,3 @@
+                SmallArrayObjs,
+                AddrOfObjs;
     AdjustStackOffset(MFI, MFI->getStackProtectorIndex(), StackGrowsDown,
----------------
Same comment here as above. One variable per declaration please.

================
Comment at: lib/CodeGen/PrologEpilogInserter.cpp:547
@@ -546,3 +546,3 @@
     Offset += MFI->getLocalFrameSize();
 
     MaxAlign = std::max(Align, MaxAlign);
----------------
Is this code identical to the one in CodeGen/LocalStackSlotAllocation.cpp? If so, please refactor it.


http://llvm-reviews.chandlerc.com/D2546



More information about the llvm-commits mailing list