forked from OSchip/llvm-project
AST import for sizeof and alignof expressions
llvm-svn: 96647
This commit is contained in:
parent
52f820ead4
commit
d8552cdc96
|
@ -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*)
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue