Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Andriychuk committed Nov 25, 2024
1 parent 2f11458 commit 5389cdf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
11 changes: 0 additions & 11 deletions include/clad/Differentiator/DiffPlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ struct DiffRequest {
} m_TbrRunInfo;

mutable struct ActivityRunInfo {
// std::set<const clang::VarDecl*> ToBeRecorded;
bool HasAnalysisRun = false;
} m_ActivityRunInfo;

Expand Down Expand Up @@ -146,16 +145,6 @@ struct DiffRequest {

bool shouldBeRecorded(clang::Expr* E) const;
bool shouldHaveAdjoint(const clang::VarDecl* VD) const;

// void setToBeRecorded(std::set<const clang::VarDecl*> init) {
// this->m_ActivityRunInfo.ToBeRecorded = init;
// }
// std::set<const clang::VarDecl*> getToBeRecorded() const {
// for(auto i: m_ActivityRunInfo.ToBeRecorded){
// AllVariedDecls.insert(i);
// }
// //return this->m_ActivityRunInfo.ToBeRecorded;
// }
};

using DiffInterval = std::vector<clang::SourceRange>;
Expand Down
6 changes: 2 additions & 4 deletions lib/Differentiator/ActivityAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<VarDecl>(D));
m_Varied = true;
} else if (VDTy->isArrayType()) {
if (VDTy->isArrayType() ||
(VDTy->isPointerType() && !innermost.isConstQualified())) {
copyVarToCurBlock(cast<VarDecl>(D));
m_Varied = true;
}
Expand Down

0 comments on commit 5389cdf

Please sign in to comment.