Redirect DataLayout from TargetMachine to Module in StackProtector
authorMehdi Amini <mehdi.amini@apple.com>
Tue, 7 Jul 2015 23:38:49 +0000 (23:38 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Tue, 7 Jul 2015 23:38:49 +0000 (23:38 +0000)
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: llvm-commits, rafael, yaron.keren

Differential Revision: http://reviews.llvm.org/D11010

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241646 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/StackProtector.cpp

index 0824d6f91db0776c0ba79a255d98b725372530a0..bcea37a3aafa7f03baf19038bd3a6476ddf0c06e 100644 (file)
@@ -122,7 +122,7 @@ bool StackProtector::ContainsProtectableArray(Type *Ty, bool &IsLarge,
 
     // If an array has more than SSPBufferSize bytes of allocated space, then we
     // emit stack protectors.
-    if (SSPBufferSize <= TLI->getDataLayout()->getTypeAllocSize(AT)) {
+    if (SSPBufferSize <= M->getDataLayout().getTypeAllocSize(AT)) {
       IsLarge = true;
       return true;
     }