зеркало из https://github.com/microsoft/clang.git
Complain about types and declarations that we don't know how to import.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95706 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
e07c5b06c4
Коммит
89cc9d6e2a
|
@ -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">;
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
|
Загрузка…
Ссылка в новой задаче