Improvements on Macro removal.
This commit is contained in:
parent
5eb9f3ee5c
commit
5d42bd5e8c
@ -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<II, MD>.
|
||||
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.
|
||||
///
|
||||
|
@ -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 && \
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user