MS inline asm: Use memory constraints for functions instead of registers
authorReid Kleckner <reid@kleckner.net>
Fri, 1 Aug 2014 20:21:24 +0000 (20:21 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 1 Aug 2014 20:21:24 +0000 (20:21 +0000)
commitab418066a27f9297d7786d4d1c0542410ade58e6
tree58b1bd36420e802d078f77e43563efec6d41d9ab
parenta2a42a6a4e23c8ed5c52f18b881c8d54fd1b59d2
MS inline asm: Use memory constraints for functions instead of registers

This is consistent with how we parse them in a standalone .s file, and
inline assembly shouldn't differ.

This fixes errors about requiring more registers than available in
cases like this:
  void f();
  void __declspec(naked) g() {
    __asm pusha
    __asm call f
    __asm popa
    __asm ret
  }

There are no registers available to pass the address of 'f' into the asm
blob.  The asm should now directly call 'f'.

Tests will land in Clang shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214550 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/AsmParser/X86AsmParser.cpp
test/CodeGen/X86/ms-inline-asm.ll