diff --git a/include/clad/Differentiator/DiffPlanner.h b/include/clad/Differentiator/DiffPlanner.h index ff120cd84..1e57f793c 100644 --- a/include/clad/Differentiator/DiffPlanner.h +++ b/include/clad/Differentiator/DiffPlanner.h @@ -34,7 +34,6 @@ struct DiffRequest { } m_TbrRunInfo; mutable struct ActivityRunInfo { - // std::set ToBeRecorded; bool HasAnalysisRun = false; } m_ActivityRunInfo; @@ -146,16 +145,6 @@ struct DiffRequest { bool shouldBeRecorded(clang::Expr* E) const; bool shouldHaveAdjoint(const clang::VarDecl* VD) const; - - // void setToBeRecorded(std::set init) { - // this->m_ActivityRunInfo.ToBeRecorded = init; - // } - // std::set getToBeRecorded() const { - // for(auto i: m_ActivityRunInfo.ToBeRecorded){ - // AllVariedDecls.insert(i); - // } - // //return this->m_ActivityRunInfo.ToBeRecorded; - // } }; using DiffInterval = std::vector; diff --git a/lib/Differentiator/ActivityAnalyzer.cpp b/lib/Differentiator/ActivityAnalyzer.cpp index d9623bbbf..38d65f037 100644 --- a/lib/Differentiator/ActivityAnalyzer.cpp +++ b/lib/Differentiator/ActivityAnalyzer.cpp @@ -160,10 +160,8 @@ bool VariedAnalyzer::VisitDeclStmt(DeclStmt* DS) { QualType innermost = VDTy; while (innermost->isPointerType()) innermost = innermost->getPointeeType(); - if (VDTy->isPointerType() && !innermost.isConstQualified()) { - copyVarToCurBlock(cast(D)); - m_Varied = true; - } else if (VDTy->isArrayType()) { + if (VDTy->isArrayType() || + (VDTy->isPointerType() && !innermost.isConstQualified())) { copyVarToCurBlock(cast(D)); m_Varied = true; }