[all-commits] [llvm/llvm-project] 8a1b5f: [llvm-ml] Add support for extern proc

Alan Zhao via All-commits all-commits at lists.llvm.org
Fri May 13 14:21:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a1b5f26808429a157835a8011e6b58fe3361e0f
      https://github.com/llvm/llvm-project/commit/8a1b5f26808429a157835a8011e6b58fe3361e0f
  Author: Alan Zhao <ayzhao at google.com>
  Date:   2022-05-13 (Fri, 13 May 2022)

  Changed paths:
    M llvm/lib/MC/MCParser/MasmParser.cpp
    M llvm/test/tools/llvm-ml/extern.asm
    M llvm/test/tools/llvm-ml/indirect_branch.asm

  Log Message:
  -----------
  [llvm-ml] Add support for extern proc

EXTERN PROC isn't really well documented in MSVC, so after poking around
it seems as if it's just a regular extern symbol.

Interestingly enough, under MSVC the following is allowed:

extern foo:proc

mov eax, foo

MSVC will output:

mov eax, 0

while llvm-ml will currently output:

mov eax, dword ptr [foo]

(since foo is an extern)

Arguably, llvm-ml's output makes more sense, even though it's
inconsistent with MSVC ml. However, since moving an extern proc symbol
to a register doesn't really make sense in the first place, we'll treat
it as undefined behavior for now.

Reviewed By: epastor

Differential Revision: https://reviews.llvm.org/D125582




More information about the All-commits mailing list