diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-06-14 23:15:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-06-14 23:15:08 +0000 |
commit | 56079f7dde1d9c9e16207feffa3f1f888a78ab69 (patch) | |
tree | 5cc5687b07f6d85fde7a3804f1346faa2bcf4f61 /lib/CodeGen/Mangle.cpp | |
parent | 732281de5d518fca96c449ae185ee56bde422c4f (diff) |
Add name mangling for address spaces. We use the vendor-extension
mangling for types, where the <source-name> is ASxxx (xxx is the
address-space number).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r-- | lib/CodeGen/Mangle.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index 011e46941d..e1e2f1069b 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -1050,6 +1050,18 @@ void CXXNameMangler::mangleQualifiers(Qualifiers Quals) { if (Quals.hasConst()) Out << 'K'; + if (Quals.hasAddressSpace()) { + // Extension: + // + // <type> ::= U <address-space-number> + // + // where <address-space-number> is a source name consisting of 'AS' + // followed by the address space <number>. + llvm::SmallString<64> ASString; + ASString = "AS" + llvm::utostr_32(Quals.getAddressSpace()); + Out << 'U' << ASString.size() << ASString; + } + // FIXME: For now, just drop all extension qualifiers on the floor. } |