зеркало из https://github.com/microsoft/clang-1.git
Added transfer function support for sizeof(void)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47443 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
cca196b553
Коммит
297d0d701d
|
@ -528,18 +528,22 @@ void GRExprEngine::VisitSizeOfAlignOfTypeExpr(SizeOfAlignOfTypeExpr* Ex,
|
|||
QualType T = Ex->getArgumentType();
|
||||
|
||||
// FIXME: Implement alignof
|
||||
// FIXME: Add support for sizeof(void)
|
||||
// FIXME: Add support for VLAs.
|
||||
|
||||
// FIXME: Add support for VLAs.
|
||||
if (!T.getTypePtr()->isConstantSizeType())
|
||||
return;
|
||||
|
||||
SourceLocation Loc = Ex->getExprLoc();
|
||||
uint64_t size = getContext().getTypeSize(T, Loc) / 8;
|
||||
|
||||
uint64_t size = 1; // Handle sizeof(void)
|
||||
|
||||
if (T != getContext().VoidTy) {
|
||||
SourceLocation Loc = Ex->getExprLoc();
|
||||
size = getContext().getTypeSize(T, Loc) / 8;
|
||||
}
|
||||
|
||||
Nodify(Dst, Ex, Pred,
|
||||
SetRVal(Pred->getState(), Ex,
|
||||
NonLVal::MakeVal(ValMgr, size, Ex->getType(), Loc)));
|
||||
NonLVal::MakeVal(ValMgr, size, Ex->getType())));
|
||||
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче