[ms-inline asm] Make the comment a bit more verbose.
authorChad Rosier <mcrosier@apple.com>
Wed, 20 Feb 2013 18:03:44 +0000 (18:03 +0000)
committerChad Rosier <mcrosier@apple.com>
Wed, 20 Feb 2013 18:03:44 +0000 (18:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175641 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86RegisterInfo.cpp

index fbe6331e84591769bc62badc6f04f14c676a31de..3b9144dc0b85f88a5ccb842a15aa6295bfa8853a 100644 (file)
@@ -389,8 +389,12 @@ bool X86RegisterInfo::hasBasePointer(const MachineFunction &MF) const {
      return false;
 
    // When we need stack realignment and there are dynamic allocas, we can't
-   // reference off of the stack pointer, so we reserve a base pointer.  This
-   // is also true if the function contain MS-style inline assembly.
+   // reference off of the stack pointer, so we reserve a base pointer.
+   //
+   // This is also true if the function contain MS-style inline assembly.  We
+   // do this because if any stack changes occur in the inline assembly, e.g.,
+   // "pusha", then any C local variable or C argument references in the
+   // inline assembly will be wrong because the SP is not properly tracked.
    if ((needsStackRealignment(MF) && MFI->hasVarSizedObjects()) ||
        MF.hasMSInlineAsm())
      return true;