[PATCH] D71677: [ms] [X86] Use "P" modifier on operands to call instructions in inline X86 assembly.

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 14:29:31 PST 2019


rnk added a comment.

Where is {0:P} actually documented? I don't see it in LangRef, but I do see it in the code.



================
Comment at: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:2871
+  // differently when referenced in MS-style inline assembly.
+  if (Name.startswith("call") || Name.startswith("lcall")) {
+    for (size_t i = 1; i < Operands.size(); ++i) {
----------------
I'm trying to think of other edge cases where we'd want the same treatment. In theory, we'd want to do this for every control flow instruction that takes a PC-relative operand, jmp, jcc, jecxz, that might be all. You know, it actually seems reasonable to set up a naked function that contains an asm blob which conditionally branches to another function, so I guess we should support it. In that case, maybe this should be named something like "isBranchTarget" instead of isCallTarget.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71677/new/

https://reviews.llvm.org/D71677





More information about the llvm-commits mailing list