[PATCH] D43805: Optionally use nameless IR types

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 26 20:32:34 PST 2018


sepavloff created this revision.
sepavloff added reviewers: rsmith, rjmccall.

Type in the LLVM IR may have names but only for the purpose of human
readability (see discussions in https://reviews.llvm.org/D40567,
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20171127/210816.html
and http://lists.llvm.org/pipermail/llvm-dev/2017-December/119585.html).
In the case when the resulting IR is not proposed for reading, for
instance, when compilation produces machine code, the type names are waste
of memory. In some cases, when types are nested in other types, the memory
expenses may be really large.

This change implements new clang option, '--ir-type-names=', which controls
if IR types should be given human readable names. The option may have
values 'use' or 'none', which turn names on or off correspondently. If no such
option was specified, compiler assign names when output may be read by a
human, namely when IR is saved beyond compilation or in debug builds.


Repository:
  rC Clang

https://reviews.llvm.org/D43805

Files:
  include/clang/Driver/Options.td
  include/clang/Frontend/CodeGenOptions.def
  include/clang/Frontend/CodeGenOptions.h
  lib/CodeGen/CodeGenAction.cpp
  lib/CodeGen/CodeGenTypes.cpp
  lib/Driver/ToolChains/Clang.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/CodeGenCXX/pr29160.cpp
  test/CodeGenCXX/type-names.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43805.136032.patch
Type: text/x-patch
Size: 8050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180227/d00aa8bc/attachment-0001.bin>


More information about the cfe-commits mailing list