RawInput mode has proven itself to be very helpful. We should have support for it

on Interpreter level and not at MetaProcessor level.


git-svn-id: http://root.cern.ch/svn/root/trunk@47881 27541ba8-7e3a-0410-8455-c3a389f83636
This commit is contained in:
Vassil Vassilev 2012-12-06 10:38:56 +00:00
parent 096a0647c2
commit b4ae9af6f1
2 changed files with 12 additions and 2 deletions

View File

@ -181,6 +181,10 @@ namespace cling {
///
bool m_DynamicLookupEnabled;
///\brief Flag toggling the raw input on or off.
///
bool m_RawInputEnabled;
///\brief Interpreter callbacks.
///
llvm::OwningPtr<InterpreterCallbacks> m_Callbacks;
@ -531,11 +535,14 @@ namespace cling {
const llvm::SmallVectorImpl<LoadedFileInfo*>& getLoadedFiles() const {
return m_LoadedFiles; }
bool isPrintingAST() { return m_PrintAST; }
void enablePrintAST(bool print = true) { m_PrintAST = print; }
void enableDynamicLookup(bool value = true);
bool isDynamicLookupEnabled() { return m_DynamicLookupEnabled; }
bool isPrintingAST() { return m_PrintAST; }
void enablePrintAST(bool print = true) { m_PrintAST = print; }
bool isRawInputEnabled() { return m_RawInputEnabled; }
void enableRawInput(bool raw = true) { m_RawInputEnabled = raw; }
clang::CompilerInstance* getCI() const;
const clang::Sema& getSema() const;

View File

@ -372,6 +372,9 @@ namespace cling {
Interpreter::CompilationResult
Interpreter::process(const std::string& input, StoredValueRef* V /* = 0 */,
const Decl** D /* = 0 */) {
if (isRawInputEnabled())
return declare(input, D);
CompilationOptions CO;
CO.DeclarationExtraction = 1;
CO.ValuePrinting = CompilationOptions::VPAuto;