summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-14 23:15:08 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-14 23:15:08 +0000
commit1726d1517e98da838cfd1a91b4e6d90e5b5a4495 (patch)
tree5bab4b99bcb48ac0a20955725d515c271fe3c406 /clang/lib/CodeGen/Mangle.cpp
parentc8c2efa7f766a275c2ff59becffb06db14e9aaf6 (diff)
downloadbcm5719-llvm-1726d1517e98da838cfd1a91b4e6d90e5b5a4495.tar.gz
bcm5719-llvm-1726d1517e98da838cfd1a91b4e6d90e5b5a4495.zip
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). llvm-svn: 105975
Diffstat (limited to 'clang/lib/CodeGen/Mangle.cpp')
-rw-r--r--clang/lib/CodeGen/Mangle.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp
index 011e46941d1..e1e2f1069b7 100644
--- a/clang/lib/CodeGen/Mangle.cpp
+++ b/clang/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.
}
OpenPOWER on IntegriCloud