CUDA type names in sizeof() expression conversion added

[ROCm/hip commit: 432500056a]
Este commit está contenido en:
atimofee
2016-02-29 20:27:38 +03:00
padre 5304ddfa1d
commit 2e75136197
+14
Ver fichero
@@ -517,6 +517,20 @@ class Cuda2HipCallback : public MatchFinder::MatchCallback {
begin = end + 1;
}
}
if (const UnaryExprOrTypeTraitExpr * expr = Result.Nodes.getNodeAs<clang::UnaryExprOrTypeTraitExpr>("cudaStructSizeOf"))
{
TypeSourceInfo * typeInfo = expr->getArgumentTypeInfo();
QualType QT = typeInfo->getType().getUnqualifiedType();
const Type * type = QT.getTypePtr();
StringRef name = type->getAsCXXRecordDecl()->getName();
StringRef repName = N.cuda2hipRename[name];
TypeLoc TL = typeInfo->getTypeLoc();
SourceLocation sl = TL.getUnqualifiedLoc().getLocStart();
Replacement Rep(*SM, SM->isMacroArgExpansion(sl) ?
SM->getImmediateSpellingLoc(sl) : sl, name.size(), repName);
Replace->insert(Rep);
}
}
private: