llvm-project/clang
Jonas Hahnfeld 3b9cbba9a8 [CUDA] Fix emission of constant strings in sections
CGM.GetAddrOfConstantCString() sets the adress of the created GlobalValue
to unnamed. When emitting the object file LLVM will mark the surrounding
section as SHF_MERGE iff the string is nul-terminated and contains no
other nuls (see IsNullTerminatedString). This results in problems when
saving temporaries because LLVM doesn't set an EntrySize, so reading in
the serialized assembly file fails.
This never happened for the GPU binaries because they usually contain
a nul-character somewhere. Instead this only affected the module ID
when compiling relocatable device code.

However, this points to a potentially larger problem: If we put a
constant string into a named section, we really want the data to end
up in that section in the object file. To avoid LLVM merging sections
this patch unmarks the GlobalVariable's address as unnamed which also
fixes the problem of invalid serialized assembly files when saving
temporaries.

Differential Revision: https://reviews.llvm.org/D47902

llvm-svn: 334281
2018-06-08 11:17:08 +00:00
..
INPUTS
bindings implementing Cursor.get_included_file in python bindings 2018-05-10 21:39:29 +00:00
cmake [Fuchsia] Include install-distribution-stripped in bootstrap targets 2018-06-06 05:18:39 +00:00
docs [Clang Tablegen][RFC] Allow Early Textual Substitutions in `Diagnostic` messages. 2018-05-19 03:12:04 +00:00
examples clang-interpreter: Add missing LLVM component Object 2018-06-03 08:12:15 +00:00
include [X86] Add builtins for shufps and shufpd to enable target feature and immediate range checking. 2018-06-08 07:18:33 +00:00
lib [CUDA] Fix emission of constant strings in sections 2018-06-08 11:17:08 +00:00
runtime [clang] Use add_llvm_install_targets 2017-11-30 22:35:02 +00:00
test [CUDA] Fix emission of constant strings in sections 2018-06-08 11:17:08 +00:00
tools [clang-fuzzer] Made loop_proto more "vectorizable". 2018-06-08 00:33:35 +00:00
unittests [clang-format] Consider tok::hashhash in python-style comments 2018-06-07 09:46:24 +00:00
utils Fix a (possible) division by zero check in the CmpRuns script 2018-05-30 11:17:55 +00:00
www [www] Update C++ status to cover P0620. 2018-05-30 23:30:36 +00:00
.arcconfig [clang] Set up .arcconfig to point to new Diffusion C repository 2017-11-27 17:21:24 +00:00
.clang-format
.clang-tidy Backport changes from llvm/.clang_tidy to clang/.clang_tidy configs 2018-03-20 14:39:12 +00:00
.gitignore
CMakeLists.txt CMake option to allow enabling experimental new pass manager by default 2018-04-06 00:53:00 +00:00
CODE_OWNERS.TXT Change code owner for Clang Static Analyzer to Devin Coughlin. 2017-11-17 23:19:04 +00:00
INSTALL.txt
LICENSE.TXT
ModuleInfo.txt
NOTES.txt
README.txt

README.txt

//===----------------------------------------------------------------------===//
// C Language Family Front-end
//===----------------------------------------------------------------------===//

Welcome to Clang.  This is a compiler front-end for the C family of languages
(C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM
compiler infrastructure project.

Unlike many other compiler frontends, Clang is useful for a number of things
beyond just compiling code: we intend for Clang to be host to a number of
different source-level tools.  One example of this is the Clang Static Analyzer.

If you're interested in more (including how to build Clang) it is best to read
the relevant web sites.  Here are some pointers:

Information on Clang:             http://clang.llvm.org/
Building and using Clang:         http://clang.llvm.org/get_started.html
Clang Static Analyzer:            http://clang-analyzer.llvm.org/
Information on the LLVM project:  http://llvm.org/

If you have questions or comments about Clang, a great place to discuss them is
on the Clang development mailing list:
  http://lists.llvm.org/mailman/listinfo/cfe-dev

If you find a bug in Clang, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/