<commit_before>//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author:  <NAME> <<EMAIL>>
//------------------------------------------------------------------------------

#include "DynamicLookup.h"

#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/InterpreterCallbacks.h"
#include "cling/Interpreter/Transaction.h"
#include "cling/Utils/AST.h"

#include "clang/AST/ASTContext.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Template.h"

using namespace clang;

namespace cling {

  DynamicIDHandler::DynamicIDHandler(Interpreter* interp)
    : m_Interpreter(interp) { }


  // pin the vtable to this file
  DynamicIDHandler::~DynamicIDHandler() {
  }

  bool DynamicIDHandler::LookupUnqualified(LookupResult& R, Scope* S) {

    InterpreterCallbacks* callbacks = m_Interpreter->getCallbacks();
    if (callbacks && callbacks->isEnabled()) {
      return callbacks->LookupObject(R, S);
    }

    if (!IsDynamicLookup(R, S))
      return false;

    DeclarationName Name = R.getLookupName();
    IdentifierInfo* II = Name.getAsIdentifierInfo();
    SourceLocation Loc = R.getNameLoc();
    ASTContext& C = m_Interpreter->getSema().getASTContext();
    VarDecl* Result = VarDecl::Create(C,
                                      R.getSema().getFunctionLevelDeclContext(),
                                      Loc,
                                      Loc,
                                      II,<commit_msg>Revert previous change which broke cling's testsuite. The issue that was addressing the previous commit will be fixed with the upcoming changes anyway.<commit_after>//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author:  <NAME> <<EMAIL>>
//------------------------------------------------------------------------------

#include "DynamicLookup.h"

#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/InterpreterCallbacks.h"
#include "cling/Interpreter/Transaction.h"
#include "cling/Utils/AST.h"

#include "clang/AST/ASTContext.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Template.h"

using namespace clang;

namespace cling {

  DynamicIDHandler::DynamicIDHandler(Interpreter* interp)
    : m_Interpreter(interp) { }


  // pin the vtable to this file
  DynamicIDHandler::~DynamicIDHandler() {
  }

  bool DynamicIDHandler::LookupUnqualified(LookupResult& R, Scope* S) {

    if (!IsDynamicLookup(R, S))
      return false;

    InterpreterCallbacks* callbacks = m_Interpreter->getCallbacks();
    if (callbacks && callbacks->isEnabled()) {
      return callbacks->LookupObject(R, S);
    }

    DeclarationName Name = R.getLookupName();
    IdentifierInfo* II = Name.getAsIdentifierInfo();
    SourceLocation Loc = R.getNameLoc();
    ASTContext& C = m_Interpreter->getSema().getASTContext();
    VarDecl* Result = VarDecl::Create(C,
                                      R.getSema().getFunctionLevelDeclContext(),
                                      Loc,
                                      Loc,
                                      II,
{'fraction_non_alphanumeric': 0.20676241771394374, 'fraction_numerical': 0.0, 'mean_word_length': 2.019873532068654, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6434083', 'n_tokens_mistral': 956, 'n_tokens_neox': 929, 'n_words': 189}