Prevent re-parse of "#include \"RuntimeUniverse.h\"".

This commit is contained in:
Axel Naumann 2015-01-22 10:43:32 +01:00 committed by sftnight
parent e7a9c01eb0
commit 5ff794a175
2 changed files with 7 additions and 2 deletions

View File

@ -158,6 +158,10 @@ namespace cling {
///
bool m_PrintDebug;
///\brief Whether DynamicLookupRuntimeUniverse.h has been parsed.
///
bool m_DynamicLookupDeclared;
///\brief Flag toggling the dynamic scopes on or off.
///
bool m_DynamicLookupEnabled;

View File

@ -166,7 +166,7 @@ namespace cling {
Interpreter::Interpreter(int argc, const char* const *argv,
const char* llvmdir /*= 0*/, bool noRuntime) :
m_UniqueCounter(0), m_PrintDebug(false),
m_UniqueCounter(0), m_PrintDebug(false), m_DynamicLookupDeclared(false),
m_DynamicLookupEnabled(false), m_RawInputEnabled(false),
m_LastCustomPragmaDiagPopPoint(){
@ -1140,11 +1140,12 @@ namespace cling {
void Interpreter::enableDynamicLookup(bool value /*=true*/) {
m_DynamicLookupEnabled = value;
if (isDynamicLookupEnabled()) {
if (!m_DynamicLookupDeclared && isDynamicLookupEnabled()) {
if (loadModuleForHeader("cling/Interpreter/DynamicLookupRuntimeUniverse.h")
!= kSuccess)
declare("#include \"cling/Interpreter/DynamicLookupRuntimeUniverse.h\"");
}
m_DynamicLookupDeclared = true;
}
Interpreter::ExecutionResult