Remove unused code.

This commit is contained in:
Vassil Vassilev 2013-09-10 12:35:39 +02:00 committed by sftnight
parent d2b1e288a4
commit c35e529cd6
4 changed files with 2 additions and 37 deletions

View File

@ -113,11 +113,6 @@ namespace cling {
///
clang::FunctionDecl* m_WrapperFD;
///\brief The wrapper function produced by the intepreter if any
/// for CallFunc.
///
clang::FunctionDecl* m_CFWrapperFD;
///\brief Next transaction in if any.
///
const Transaction* m_Next;
@ -365,7 +360,6 @@ namespace cling {
void setModule(llvm::Module* M) { m_Module = M ; }
clang::FunctionDecl* getWrapperFD() const { return m_WrapperFD; }
clang::FunctionDecl* getCFWrapperFD() const { return m_CFWrapperFD; }
const Transaction* getNext() const { return m_Next; }
void setNext(Transaction* T) { m_Next = T; }

View File

@ -41,16 +41,6 @@ namespace utils {
///
static bool IsWrapper(const clang::NamedDecl* ND);
///\brief Checks whether the declaration is a interpreter-generated
/// CallFunc wrapper function.
///
///\param[in] ND - The decl being checked. If null returns false.
///
///\returns true if the decl is a interpreter-generated CallFunc wrapper
/// function.
///
static bool IsCFWrapper(const clang::NamedDecl* ND);
///\brief Retrieves the last expression of a function body. If it was a
/// DeclStmt with a variable declaration, creates DeclRefExpr and adds it to
/// the function body.
@ -79,7 +69,6 @@ namespace utils {
class Synthesize {
public:
static const char* const UniquePrefix;
static const char* const CFUniquePrefix;
///\brief Synthesizes c-style cast in the AST from given pointer and type to
/// cast to.

View File

@ -35,7 +35,6 @@ namespace cling {
m_Opts = CompilationOptions();
m_Module = 0;
m_WrapperFD = 0;
m_CFWrapperFD = 0;
m_Next = 0;
//m_ASTContext = C;
}
@ -98,7 +97,6 @@ namespace cling {
m_NestedTransactions.reset(0); // FIXME: leaks the nested transactions.
m_Module = 0;
m_WrapperFD = 0;
m_CFWrapperFD = 0;
m_Next = 0;
}
@ -142,21 +140,15 @@ namespace cling {
#endif
bool checkForWrapper = !m_WrapperFD;
bool checkForCFWrapper = !m_CFWrapperFD;
// FIXME: Assignment in assert!!!!
assert(checkForWrapper = true && "Check for wrappers with asserts");
// register the wrapper if any.
if ((checkForWrapper || checkForCFWrapper) && !DCI.m_DGR.isNull() &&
DCI.m_DGR.isSingleDecl()) {
if (FunctionDecl* FD =
dyn_cast<FunctionDecl>(DCI.m_DGR.getSingleDecl())) {
if ((checkForWrapper) && !DCI.m_DGR.isNull() && DCI.m_DGR.isSingleDecl()) {
if (FunctionDecl* FD = dyn_cast<FunctionDecl>(DCI.m_DGR.getSingleDecl())){
if (checkForWrapper && utils::Analyze::IsWrapper(FD)) {
assert(!m_WrapperFD && "Two wrappers in one transaction?");
m_WrapperFD = FD;
}
if (checkForCFWrapper && utils::Analyze::IsCFWrapper(FD)) {
m_CFWrapperFD = FD;
}
}
}

View File

@ -40,15 +40,6 @@ namespace utils {
.startswith(Synthesize::UniquePrefix);
}
bool Analyze::IsCFWrapper(const NamedDecl* ND) {
if (!ND) {
return false;
}
bool ret = StringRef(ND->getNameAsString()).startswith(
Synthesize::CFUniquePrefix);
return ret;
}
Expr* Analyze::GetOrCreateLastExpr(FunctionDecl* FD,
int* FoundAt /*=0*/,
bool omitDeclStmts /*=true*/,
@ -112,7 +103,6 @@ namespace utils {
}
const char* const Synthesize::UniquePrefix = "__cling_Un1Qu3";
const char* const Synthesize::CFUniquePrefix = "__cf_Un1Qu3";
Expr* Synthesize::CStyleCastPtrExpr(Sema* S, QualType Ty, uint64_t Ptr) {
ASTContext& Ctx = S->getASTContext();