<div dir="ltr"><div dir="ltr"><a href="https://llvm.org/docs/LangRef.html#structure-types">https://llvm.org/docs/LangRef.html#structure-types</a><br></div><div dir="ltr"><br></div><div>Fundamentally, llvm is not designed to preserve details about front end language features.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 7 Feb 2019 at 00:09, Peng Yu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I have the following C code.<br>
<br>
#define PTR_T char *<br>
<br>
typedef struct objcache {<br>
  PTR_T data;<br>
  int cs;   /* cache size, number of objects */<br>
  int nc;   /* number of cache entries */<br>
} sh_obj_cache_t;<br>
<br>
struct dstack {<br>
  char *delimiters;<br>
  int delimiter_depth;<br>
  int delimiter_space;<br>
};<br>
<br>
When it is configured/made to generate IR with the following<br>
environment variables,<br>
<br>
CC=clang CXX=clang++ RANLIB=llvm-ranlib CFLAGS=-flto LDFLAGS=-flto\<br>
-fuse-ld=gold\ -Wl\,-plugin-opt=save-temps<br>
<br>
I see all the variables declared as sh_obj_cache_t in the source code<br>
becomes of type %struct.dstack instead of %struct.objcache.<br>
<br>
sh_obj_cache_t wdcache = {0, 0, 0};<br>
<br>
@wdcache = dso_local global %struct.dstack zeroinitializer, align 8, !dbg !1189<br>
<br>
If I directly compile the .c file to .ll, I will not see this problem.<br>
<br>
Is there a way to still use the configure/make toolchain, yet still<br>
maintain the original type information instead of consolidating types<br>
of the same data? Thanks.<br>
<br>
-- <br>
Regards,<br>
Peng<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>