зеркало из https://github.com/microsoft/clang.git
AST import for sizeof and alignof expressions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96647 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
4408063066
Коммит
bd249a5428
|
@ -112,6 +112,7 @@ namespace {
|
|||
Expr *VisitCharacterLiteral(CharacterLiteral *E);
|
||||
Expr *VisitParenExpr(ParenExpr *E);
|
||||
Expr *VisitUnaryOperator(UnaryOperator *E);
|
||||
Expr *VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E);
|
||||
Expr *VisitBinaryOperator(BinaryOperator *E);
|
||||
Expr *VisitCompoundAssignOperator(CompoundAssignOperator *E);
|
||||
Expr *VisitImplicitCastExpr(ImplicitCastExpr *E);
|
||||
|
@ -2663,6 +2664,30 @@ Expr *ASTNodeImporter::VisitUnaryOperator(UnaryOperator *E) {
|
|||
Importer.Import(E->getOperatorLoc()));
|
||||
}
|
||||
|
||||
Expr *ASTNodeImporter::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) {
|
||||
QualType ResultType = Importer.Import(E->getType());
|
||||
|
||||
if (E->isArgumentType()) {
|
||||
TypeSourceInfo *TInfo = Importer.Import(E->getArgumentTypeInfo());
|
||||
if (!TInfo)
|
||||
return 0;
|
||||
|
||||
return new (Importer.getToContext()) SizeOfAlignOfExpr(E->isSizeOf(),
|
||||
TInfo, ResultType,
|
||||
Importer.Import(E->getOperatorLoc()),
|
||||
Importer.Import(E->getRParenLoc()));
|
||||
}
|
||||
|
||||
Expr *SubExpr = Importer.Import(E->getArgumentExpr());
|
||||
if (!SubExpr)
|
||||
return 0;
|
||||
|
||||
return new (Importer.getToContext()) SizeOfAlignOfExpr(E->isSizeOf(),
|
||||
SubExpr, ResultType,
|
||||
Importer.Import(E->getOperatorLoc()),
|
||||
Importer.Import(E->getRParenLoc()));
|
||||
}
|
||||
|
||||
Expr *ASTNodeImporter::VisitBinaryOperator(BinaryOperator *E) {
|
||||
QualType T = Importer.Import(E->getType());
|
||||
if (T.isNull())
|
||||
|
|
|
@ -3,6 +3,7 @@ enum E0 {
|
|||
E0_Val0 = 'a',
|
||||
E0_Val1 = (17),
|
||||
E0_Val2 = (1 << 2),
|
||||
E0_Val3 = E0_Val2
|
||||
E0_Val3 = E0_Val2,
|
||||
E0_Val4 = sizeof(int*)
|
||||
};
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ enum E0 {
|
|||
E0_Val0 = 'a',
|
||||
E0_Val1 = (17),
|
||||
E0_Val2 = (1 << 2),
|
||||
E0_Val3 = E0_Val2
|
||||
E0_Val3 = E0_Val2,
|
||||
E0_Val4 = sizeof(int*)
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче