[llvm] r175641 - [ms-inline asm] Make the comment a bit more verbose.
Chad Rosier
mcrosier at apple.com
Wed Feb 20 10:03:44 PST 2013
Author: mcrosier
Date: Wed Feb 20 12:03:44 2013
New Revision: 175641
URL: http://llvm.org/viewvc/llvm-project?rev=175641&view=rev
Log:
[ms-inline asm] Make the comment a bit more verbose.
Modified:
llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=175641&r1=175640&r2=175641&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Wed Feb 20 12:03:44 2013
@@ -389,8 +389,12 @@ bool X86RegisterInfo::hasBasePointer(con
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;
More information about the llvm-commits
mailing list