[PATCH] D19852: [safestack] Use non-thread-local unsafe stack pointer for Contiki OS

Michael LeMay via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 16:00:44 PDT 2016


mlemay-intel added inline comments.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:2025
@@ -2024,1 +2024,3 @@
 Value *X86TargetLowering::getSafeStackPointerLocation(IRBuilder<> &IRB) const {
+  if (Subtarget.isTargetContiki()) {
+    const char *Name = "__safestack_unsafe_stack_ptr";
----------------
pcc wrote:
> You might also consider moving the SafeStack::getOrCreateUnsafeStackPtr implementation into a utility function in TargetLoweringBase that takes a bool UseTLS. Then guarantee that getSafeStackPointerLocation always returns non-null and you can remove SafeStack::getOrCreateUnsafeStackPtr altogehter.
That would be a nice way to eliminate this redundancy.  However, the SafeStack pass is written to support TL being null.  How would your suggested approach handle that case?


https://reviews.llvm.org/D19852





More information about the llvm-commits mailing list