Skip to content
Snippets Groups Projects
Commit 6566a7a2 authored by Axel Naumann's avatar Axel Naumann
Browse files

Cache result of type transform.

parent a3c34942
No related branches found
No related tags found
No related merge requests found
......@@ -576,10 +576,11 @@ static const char* BuildAndEmitVPWrapperBody(cling::Interpreter &Interp,
if (auto PT = llvm::dyn_cast<clang::PointerType>(QT.getTypePtr())) {
// Normalize `X*` to `const void*`, invoke `printValue(const void**)`,
// unless it's a character string.
if (!Ctx.hasSameType(PT->getPointeeType().getUnqualifiedType(), Ctx.CharTy)
&& !Ctx.hasSameType(PT->getPointeeType().getUnqualifiedType(), Ctx.WCharTy)
&& !Ctx.hasSameType(PT->getPointeeType().getUnqualifiedType(), Ctx.Char16Ty)
&& !Ctx.hasSameType(PT->getPointeeType().getUnqualifiedType(), Ctx.Char32Ty)) {
clang::QualType QTPointeeUnqual = PT->getPointeeType().getUnqualifiedType();
if (!Ctx.hasSameType(QTPointeeUnqual, Ctx.CharTy)
&& !Ctx.hasSameType(QTPointeeUnqual, Ctx.WCharTy)
&& !Ctx.hasSameType(QTPointeeUnqual, Ctx.Char16Ty)
&& !Ctx.hasSameType(QTPointeeUnqual, Ctx.Char32Ty)) {
QT = Ctx.VoidTy;
QT.addConst();
QT = Ctx.getPointerType(QT);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment