[llvm-branch-commits] [llvm-gcc-branch] r95015 - /llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin-c.c
Bill Wendling
isanbard at gmail.com
Mon Feb 1 14:37:10 PST 2010
Author: void
Date: Mon Feb 1 16:37:10 2010
New Revision: 95015
URL: http://llvm.org/viewvc/llvm-project?rev=95015&view=rev
Log:
$ svn merge -c 95013 https://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk
--- Merging r95013 into '.':
U gcc/config/darwin-c.c
Modified:
llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin-c.c
Modified: llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin-c.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin-c.c?rev=95015&r1=95014&r2=95015&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin-c.c (original)
+++ llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/config/darwin-c.c Mon Feb 1 16:37:10 2010
@@ -1204,10 +1204,22 @@
static int num;
const char *name_prefix = "__utf16_string_";
char *name;
+ int embedNull = 0;
if (!cvt_utf8_utf16 (inbuf, length, &uniCharBuf, numUniChars))
return NULL_TREE;
+ /* LLVM LOCAL begin 7589850. */
+ /* ustring with embedded null should go into __const. It should not be forced
+ into "__TEXT,__ustring" section. */
+ for (l = 0; l < length; l++) {
+ if (!inbuf[l]) {
+ embedNull = 1;
+ break;
+ }
+ }
+ /* LLVM LOCAL end 7589850. */
+
for (l = 0; l < *numUniChars; l++)
initlist = tree_cons (NULL_TREE, build_int_cst (char_type_node, uniCharBuf[l]), initlist);
/* LLVM LOCAL utf16 has two trailing nulls 7095855 */
@@ -1226,9 +1238,12 @@
TREE_READONLY (decl) = 1;
/* LLVM LOCAL end */
- attribute = tree_cons (NULL_TREE, build_string (len, section_name), NULL_TREE);
- attribute = tree_cons (get_identifier ("section"), attribute, NULL_TREE);
- decl_attributes (&decl, attribute, 0);
+ /* LLVM LOCAL 7589850 */
+ if (!embedNull) {
+ attribute = tree_cons (NULL_TREE, build_string (len, section_name), NULL_TREE);
+ attribute = tree_cons (get_identifier ("section"), attribute, NULL_TREE);
+ decl_attributes (&decl, attribute, 0);
+ }
attribute = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 2), NULL_TREE);
attribute = tree_cons (get_identifier ("aligned"), attribute, NULL_TREE);
decl_attributes (&decl, attribute, 0);
More information about the llvm-branch-commits
mailing list