diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2011-11-08 02:52:58 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-11-08 02:52:58 +0000 |
| commit | 5ad3ebaefd65263ddd6adfe1c309819f9d19e5dc (patch) | |
| tree | 47fed9fd934f3778277942ab78da8232dd158535 /clang/lib/AST | |
| parent | 32fab902dec903ad007df603a4365ac0f61a8f3d (diff) | |
| download | bcm5719-llvm-5ad3ebaefd65263ddd6adfe1c309819f9d19e5dc.tar.gz bcm5719-llvm-5ad3ebaefd65263ddd6adfe1c309819f9d19e5dc.zip | |
TypePrinter: print OpenCL address space names. Patch by Richard
Membarth, test case by myself.
llvm-svn: 144063
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/TypePrinter.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index ec6cb48bf86..e11e5065728 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -1162,9 +1162,21 @@ void Qualifiers::getAsStringInternal(std::string &S, AppendTypeQualList(S, getCVRQualifiers()); if (unsigned addrspace = getAddressSpace()) { if (!S.empty()) S += ' '; - S += "__attribute__((address_space("; - S += llvm::utostr_32(addrspace); - S += ")))"; + switch (addrspace) { + case LangAS::opencl_global: + S += "__global"; + break; + case LangAS::opencl_local: + S += "__local"; + break; + case LangAS::opencl_constant: + S += "__constant"; + break; + default: + S += "__attribute__((address_space("; + S += llvm::utostr_32(addrspace); + S += ")))"; + } } if (Qualifiers::GC gc = getObjCGCAttr()) { if (!S.empty()) S += ' '; |

