diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-31 23:42:16 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-31 23:42:16 +0000 |
commit | 8e5c2b8072f4409c7c0004331d1db9652d5209c0 (patch) | |
tree | a0f47dbd90b7d5e4bcd465fee087c508de35ee0c /lib/Basic/Targets.cpp | |
parent | 3106198188ac6eb2753f1764d5c28376b0b76351 (diff) |
Add Target hooks for IRgen of [cf]string literals.
- Notably, set section on cfstring literal string data (for now, this
is done everywhere because it matches what we were already doing
for the CFString data itself)
- <rdar://problem/6599098> [irgen] linker requires objc string data
to go into cstring
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Targets.cpp')
-rw-r--r-- | lib/Basic/Targets.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index b3224fe1d2..ce55ec8046 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -653,11 +653,21 @@ public: "i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-" "a0:0:64-f80:128:128"; } + + virtual const char *getStringSymbolPrefix(bool IsConstant) const { + return IsConstant ? "\01LC" : "\01lC"; + } + + virtual const char *getCFStringSymbolPrefix() const { + return "\01LC"; + } + virtual void getTargetDefines(const LangOptions &Opts, std::vector<char> &Defines) const { X86_32TargetInfo::getTargetDefines(Opts, Defines); getDarwinDefines(Defines, getTargetTriple()); } + /// getDefaultLangOptions - Allow the target to specify default settings for /// various language options. These may be overridden by command line /// options. @@ -796,6 +806,14 @@ public: DarwinX86_64TargetInfo(const std::string& triple) : X86_64TargetInfo(triple) {} + virtual const char *getStringSymbolPrefix(bool IsConstant) const { + return IsConstant ? "\01LC" : "\01lC"; + } + + virtual const char *getCFStringSymbolPrefix() const { + return "\01L_unnamed_cfstring_"; + } + virtual void getTargetDefines(const LangOptions &Opts, std::vector<char> &Defines) const { X86_64TargetInfo::getTargetDefines(Opts, Defines); |