diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2014-04-26 00:14:00 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2014-04-26 00:14:00 +0000 |
commit | 0c2986f78e8f7b4f3207e1b0b7ff3a9253753185 (patch) | |
tree | 49c16504d029f3c432a39557501725884e662a03 /clang/lib/AST/ItaniumMangle.cpp | |
parent | d71f110fe92c0549499403cbfdd0da786991b7ad (diff) | |
download | bcm5719-llvm-0c2986f78e8f7b4f3207e1b0b7ff3a9253753185.tar.gz bcm5719-llvm-0c2986f78e8f7b4f3207e1b0b7ff3a9253753185.zip |
Add mangling for attribute enable_if. The demangling patch for libcxxabi is still in review.
llvm-svn: 207296
Diffstat (limited to 'clang/lib/AST/ItaniumMangle.cpp')
-rw-r--r-- | clang/lib/AST/ItaniumMangle.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp index bb7de2f0809..0e332a6f2de 100644 --- a/clang/lib/AST/ItaniumMangle.cpp +++ b/clang/lib/AST/ItaniumMangle.cpp @@ -456,6 +456,25 @@ void CXXNameMangler::mangleFunctionEncoding(const FunctionDecl *FD) { if (!Context.shouldMangleDeclName(FD)) return; + if (FD->hasAttr<EnableIfAttr>()) { + FunctionTypeDepthState Saved = FunctionTypeDepth.push(); + Out << "Ua9enable_ifI"; + // FIXME: specific_attr_iterator iterates in reverse order. Fix that and use + // it here. + for (AttrVec::const_reverse_iterator I = FD->getAttrs().rbegin(), + E = FD->getAttrs().rend(); + I != E; ++I) { + EnableIfAttr *EIA = dyn_cast<EnableIfAttr>(*I); + if (!EIA) + continue; + Out << 'X'; + mangleExpression(EIA->getCond()); + Out << 'E'; + } + Out << 'E'; + FunctionTypeDepth.pop(Saved); + } + // Whether the mangling of a function type includes the return type depends on // the context and the nature of the function. The rules for deciding whether // the return type is included are: |