<div dir="ltr">Given the following code:<div><br></div><div>struct Unknown;<br>extern struct Unknown Unknown;<br><br>struct Unknown *foo(void) {<br>  return &Unknown;<br>}<br></div><div><br></div><div>And compiling it with a recent (trunk of a few days ago) clang with default options gives (abridged):</div><div><br></div><div>%struct.Unknown = type opaque<br><br>@Unknown = external dso_local global %struct.Unknown, align 1<br><br>; Function Attrs: noinline nounwind optnone uwtable<br>define dso_local %struct.Unknown* @foo() #0 {<br>entry:<br>  ret %struct.Unknown* @Unknown<br>}<br></div><div><br></div><div>Okay, so I think I understand what's going on there. Now, trying the same input with the same compiler and adding the option -mllvm -opaque-pointers (because opaque pointers are good; I think they are a very worthwhile simplification):</div><div><br></div><div>@Unknown = external dso_local global %struct.Unknown, align 1<br><br>; Function Attrs: noinline nounwind optnone uwtable<br>define dso_local ptr @foo() #0 {<br>entry:<br>  ret ptr @Unknown<br>}<br></div><div><br></div><div>So that's mostly clear except one thing I'm not quite clear about: %struct.Unknown is referred to, but not declared anywhere. Is that intentional? Is the rule now intended to be that whenever a %<a href="http://type.name">type.name</a> is used that was not declared anywhere, it should be taken to be an opaque type? (I'm fine with that if it is, just figure I better make sure.)</div></div>