diff options
author | James Y Knight <jyknight@google.com> | 2016-03-04 19:00:41 +0000 |
---|---|---|
committer | James Y Knight <jyknight@google.com> | 2016-03-04 19:00:41 +0000 |
commit | e85ad572986c6fbbc45f361b706ea831c5ecf004 (patch) | |
tree | 54db30acb8783265d490c97c10c0b21056ea194f /lib/AST/Mangle.cpp | |
parent | 0c35e452895ad039178f3a19e90a1c36b4554749 (diff) | |
download | clang-e85ad572986c6fbbc45f361b706ea831c5ecf004.tar.gz |
Make TargetInfo store an actual DataLayout instead of a string.
Use it to calculate UserLabelPrefix, instead of specifying it (often
incorrectly).
Note that the *actual* user label prefix has always come from the
DataLayout, and is handled within LLVM. The main thing clang's
TargetInfo::UserLabelPrefix did was to set the #define value. Having
these be different from each-other is just silly.
Differential Revision: http://reviews.llvm.org/D17183
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Mangle.cpp')
-rw-r--r-- | lib/AST/Mangle.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/AST/Mangle.cpp b/lib/AST/Mangle.cpp index 7a9cf18acc..ee241732e8 100644 --- a/lib/AST/Mangle.cpp +++ b/lib/AST/Mangle.cpp @@ -126,9 +126,9 @@ void MangleContext::mangleName(const NamedDecl *D, raw_ostream &Out) { // llvm mangler on ELF is a nop, so we can just avoid adding the \01 // marker. We also avoid adding the marker if this is an alias for an // LLVM intrinsic. - StringRef UserLabelPrefix = - getASTContext().getTargetInfo().getUserLabelPrefix(); - if (!UserLabelPrefix.empty() && !ALA->getLabel().startswith("llvm.")) + char GlobalPrefix = + getASTContext().getTargetInfo().getDataLayout().getGlobalPrefix(); + if (GlobalPrefix && !ALA->getLabel().startswith("llvm.")) Out << '\01'; // LLVM IR Marker for __asm("foo") Out << ALA->getLabel(); |