diff --git a/include/cling/Interpreter/Transaction.h b/include/cling/Interpreter/Transaction.h index 462e33bc..be290d07 100644 --- a/include/cling/Interpreter/Transaction.h +++ b/include/cling/Interpreter/Transaction.h @@ -80,6 +80,8 @@ namespace cling { /// call sequence that originally occurred in clang. /// struct MacroDecl { + // We need to store both the IdentifierInfo and the MacroDirective + // because the Preprocessor stores the macros in a DenseMap. clang::IdentifierInfo* m_II; const clang::MacroDirective* m_MD; MacroDecl(clang::IdentifierInfo* II, const clang::MacroDirective* MD) @@ -411,9 +413,6 @@ namespace cling { ///\brief Appends teh declaration of a macro. void append(MacroDecl MDE); - - ///\brief Appends teh declaration of a macro. - void forceAppend(MacroDecl MDE); ///\brief Clears all declarations in the transaction. /// diff --git a/lib/Interpreter/ASTNodeEraser.cpp b/lib/Interpreter/ASTNodeEraser.cpp index 388bee26..abba1f4e 100644 --- a/lib/Interpreter/ASTNodeEraser.cpp +++ b/lib/Interpreter/ASTNodeEraser.cpp @@ -788,7 +788,8 @@ namespace cling { PP.removeMacro(MacroD.m_II, MacroD.m_MD); // ExistsInPP - // true true -> true // In the context and can delete + // true true -> true // In the Preprocessor Macros + // and can delete // false true -> assert // Not in the Preprocessor Macros // but can delete ? assert(!ExistsInPP && \ diff --git a/lib/Interpreter/Transaction.cpp b/lib/Interpreter/Transaction.cpp index b8fd57b3..89beacff 100644 --- a/lib/Interpreter/Transaction.cpp +++ b/lib/Interpreter/Transaction.cpp @@ -178,14 +178,6 @@ namespace cling { assert(!MDE.m_MD && "Appending null MacroDirective?!"); assert(getState() == kCollecting && "Cannot append declarations in current state."); - forceAppend(MDE); - } - - void Transaction::forceAppend(MacroDecl MDE) { - assert(!MDE.m_II && "Appending null IdentifierInfo?!"); - assert(!MDE.m_MD && "Appending null MacroDirective?!"); - assert(getState() == kCollecting - && "Cannot append declarations in current state."); #ifndef NDEBUG // Check for duplicates for (size_t i = 0, e = m_MacroDeclQueue.size(); i < e; ++i) {