diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-03-24 21:43:36 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-03-24 21:43:36 +0000 |
commit | 58e5bee17aa1a0ea0c690f9909f5522541e17f95 (patch) | |
tree | 56194f2a89abe9de002cb39bf42115400d4d89eb /clang/test/CodeGen/wchar-const.c | |
parent | c89450e0546154f69e1afc9b0bdf5a660ee4d558 (diff) | |
download | bcm5719-llvm-58e5bee17aa1a0ea0c690f9909f5522541e17f95.tar.gz bcm5719-llvm-58e5bee17aa1a0ea0c690f9909f5522541e17f95.zip |
MS ABI: Eliminate Duplicate Strings
COFF doesn't have mergeable sections so LLVM/clang's normal tactics for
string deduplication will not have any effect.
To remedy this we place each string inside it's own section and mark
the section as IMAGE_COMDAT_SELECT_ANY. However, we can only do this if the
string has an external name that we can generate from it's contents.
To be compatible with MSVC, we must use their scheme. Otherwise identical
strings in translation units from clang may not be deduplicated with
translation units in MSVC.
This fixes PR18248.
N.B. We will not attempt to do anything with a string literal which is not of
type 'char' or 'wchar_t' because their compiler does not support unicode
string literals as of this date. Further, we avoid doing this if
either -fwritable-strings or -fsanitize=address are present.
This reverts commit r204596.
llvm-svn: 204675
Diffstat (limited to 'clang/test/CodeGen/wchar-const.c')
-rw-r--r-- | clang/test/CodeGen/wchar-const.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CodeGen/wchar-const.c b/clang/test/CodeGen/wchar-const.c index 2e9af53a14d..34da249639e 100644 --- a/clang/test/CodeGen/wchar-const.c +++ b/clang/test/CodeGen/wchar-const.c @@ -15,7 +15,7 @@ typedef __WCHAR_TYPE__ wchar_t; // CHECK-DAR: private unnamed_addr constant [18 x i32] [i32 84, -// CHECK-WIN: private unnamed_addr constant [18 x i16] [i16 84, +// CHECK-WIN: linkonce_odr unnamed_addr constant [18 x i16] [i16 84, extern void foo(const wchar_t* p); int main (int argc, const char * argv[]) { |