[llvm-dev] Not to consolidate two structs with the same data types (but different names) in configure/make tool chain (original) (raw)

Jeremy Lakeman via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 6 18:24:54 PST 2019


https://llvm.org/docs/LangRef.html#structure-types

Fundamentally, llvm is not designed to preserve details about front end language features.

On Thu, 7 Feb 2019 at 00:09, Peng Yu via llvm-dev <llvm-dev at lists.llvm.org> wrote:

Hi,

I have the following C code. #define PTRT char * typedef struct objcache { PTRT data; int cs; /* cache size, number of objects */ int nc; /* number of cache entries */ } shobjcachet; struct dstack { char *delimiters; int delimiterdepth; int delimiterspace; }; When it is configured/made to generate IR with the following environment variables, _CC=clang CXX=clang++ RANLIB=llvm-ranlib CFLAGS=-flto LDFLAGS=-flto_ -fuse-ld=gold\ -Wl,-plugin-opt=save-temps I see all the variables declared as shobjcachet in the source code becomes of type %struct.dstack instead of %struct.objcache. shobjcachet wdcache = {0, 0, 0}; @wdcache = dsolocal global %struct.dstack zeroinitializer, align 8, !dbg !1189 If I directly compile the .c file to .ll, I will not see this problem. Is there a way to still use the configure/make toolchain, yet still maintain the original type information instead of consolidating types of the same data? Thanks. -- Regards, Peng


LLVM Developers mailing list llvm-dev at lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190207/f914330d/attachment.html>



More information about the llvm-dev mailing list