[PATCH] D123300: [Clang] Enable opaque pointers by default
    Mikael Holmén via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Thu Apr 14 01:51:41 PDT 2022
    
    
  
uabelho added a comment.
Hi,
I noticed this produces broken code:
clang -cc1 -triple amdgcn-- -emit-llvm -o - -x c op.c
with op.c being
  void bar();
  
  void foo() {
    bar();
  }
The result is
  define dso_local void @foo() #0 {
  entry:
    call void @bar(i32 noundef 42)
    ret void
  }
  
  declare void @bar(...) #1
and feeding it to e.g. opt we get
  build-all-builtins/bin/opt: <stdin>:9:13: error: invalid forward reference to function 'bar' with wrong type: expected 'void (...)*' but was 'void ()*'
    call void @bar()
              ^
Probably the same for several targets.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123300/new/
https://reviews.llvm.org/D123300
    
    
More information about the cfe-commits
mailing list