Complain about types and declarations that we don't know how to import.

llvm-svn: 95706
This commit is contained in:
Douglas Gregor 2010-02-09 22:48:33 +00:00
parent 44e16a3f4c
commit e4c83e4e2e
2 changed files with 15 additions and 0 deletions

View File

@ -34,4 +34,5 @@ def err_odr_variable_multiple_def : Error<
"external variable %0 defined in multiple translation units">;
def note_odr_value_here : Note<"declared here with type %0">;
def note_odr_defined_here : Note<"also defined here">;
def err_unsupported_ast_node: Error<"cannot import unsupported AST node %0">;
}

View File

@ -33,6 +33,7 @@ namespace {
using DeclVisitor<ASTNodeImporter, Decl *>::Visit;
// Importing types
QualType VisitType(Type *T);
QualType VisitBuiltinType(BuiltinType *T);
QualType VisitComplexType(ComplexType *T);
QualType VisitPointerType(PointerType *T);
@ -68,6 +69,7 @@ namespace {
QualType VisitObjCObjectPointerType(ObjCObjectPointerType *T);
// Importing declarations
Decl *VisitDecl(Decl *D);
Decl *VisitVarDecl(VarDecl *D);
};
}
@ -76,6 +78,12 @@ namespace {
// Import Types
//----------------------------------------------------------------------------
QualType ASTNodeImporter::VisitType(Type *T) {
Importer.FromDiag(SourceLocation(), diag::err_unsupported_ast_node)
<< T->getTypeClassName();
return QualType();
}
QualType ASTNodeImporter::VisitBuiltinType(BuiltinType *T) {
switch (T->getKind()) {
case BuiltinType::Void: return Importer.getToContext().VoidTy;
@ -435,6 +443,12 @@ QualType ASTNodeImporter::VisitObjCObjectPointerType(ObjCObjectPointerType *T) {
//----------------------------------------------------------------------------
// Import Declarations
//----------------------------------------------------------------------------
Decl *ASTNodeImporter::VisitDecl(Decl *D) {
Importer.FromDiag(SourceLocation(), diag::err_unsupported_ast_node)
<< D->getDeclKindName();
return 0;
}
Decl *ASTNodeImporter::VisitVarDecl(VarDecl *D) {
// Import the context of this declaration.
DeclContext *DC = Importer.ImportContext(D->getDeclContext());