Propagate the new callback to our InterpreterCallbacks interface.

This commit is contained in:
Vassil Vassilev 2013-09-09 11:35:05 +02:00 committed by sftnight
parent a779afdcc1
commit 1a2a7862c5
2 changed files with 16 additions and 0 deletions

View File

@ -21,6 +21,7 @@ namespace clang {
class LookupResult;
class NamedDecl;
class Scope;
class TagDecl;
class Type;
}
@ -110,8 +111,10 @@ namespace cling {
///
/// \returns true if lookup result is found and should be used.
///
// FIXME: Find a way to merge the three of them.
virtual bool LookupObject(clang::LookupResult&, clang::Scope*);
virtual bool LookupObject(const clang::DeclContext*, clang::DeclarationName);
virtual bool LookupObject(clang::TagDecl*);
///\brief This callback is invoked whenever interpreter has committed new
/// portion of declarations.
@ -177,6 +180,9 @@ namespace cling {
bool LookupObject(const clang::DeclContext*, clang::DeclarationName) {
return false;
}
bool LookupObject(clang::TagDecl* Tag) {
return false;
}
bool ShouldResolveAtRuntime(clang::LookupResult& R, clang::Scope* S);
};
} // end test

View File

@ -101,6 +101,11 @@ namespace cling {
return false;
}
virtual void CompleteType(TagDecl* Tag) {
if (m_Callbacks)
m_Callbacks->LookupObject(Tag);
}
void UpdateWithNewDeclsFwd(const DeclContext *DC, DeclarationName Name,
llvm::ArrayRef<NamedDecl*> Decls) {
SetExternalVisibleDeclsForName(DC, Name, Decls);
@ -183,6 +188,11 @@ namespace cling {
return false;
}
bool InterpreterCallbacks::LookupObject(TagDecl*) {
// Default implementation is no op.
return false;
}
void InterpreterCallbacks::UpdateWithNewDecls(const DeclContext *DC,
DeclarationName Name,
llvm::ArrayRef<NamedDecl*> Decls) {