[all-commits] [llvm/llvm-project] 5cc87b: [AsmParser] Add missing globals declarations in in...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Jan 31 03:24:48 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5cc87b424be87db4247f34ae5477be8b09a573e9
      https://github.com/llvm/llvm-project/commit/5cc87b424be87db4247f34ae5477be8b09a573e9
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-01-31 (Wed, 31 Jan 2024)

  Changed paths:
    M llvm/lib/AsmParser/LLParser.cpp
    A llvm/test/Assembler/incomplete-ir-declarations.ll

  Log Message:
  -----------
  [AsmParser] Add missing globals declarations in incomplete IR mode (#79855)

If `-allow-incomplete-ir` is enabled, automatically insert declarations
for missing globals.

If a global is only used in calls with the same function type, insert a
function declaration with that type.

Otherwise, insert a dummy i8 global. The fallback case could be extended
with various heuristics (e.g. we could look at load/store types), but
I've chosen to keep it simple for now, because I'm unsure to what degree
this would really useful without more experience. I expect that in most
cases the declaration type doesn't really matter (note that the type of
an external global specifies a *minimum* size only, not a precise size).

This is a followup to https://github.com/llvm/llvm-project/pull/78421.




More information about the All-commits mailing list