-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass the DiffRequest down to the visitors. NFC. #933
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,11 +99,11 @@ namespace clad { | |
/// A base class for all common functionality for visitors | ||
class VisitorBase { | ||
protected: | ||
VisitorBase(DerivativeBuilder& builder) | ||
VisitorBase(DerivativeBuilder& builder, const DiffRequest& request) | ||
: m_Builder(builder), m_Sema(builder.m_Sema), | ||
m_CladPlugin(builder.m_CladPlugin), m_Context(builder.m_Context), | ||
m_DerivativeFnScope(nullptr), m_DerivativeInFlight(false), | ||
m_Derivative(nullptr), m_Function(nullptr) {} | ||
m_Derivative(nullptr), m_DiffReq(request) {} | ||
|
||
using Stmts = llvm::SmallVector<clang::Stmt*, 16>; | ||
|
||
|
@@ -117,8 +117,8 @@ namespace clad { | |
bool m_DerivativeInFlight; | ||
/// The Derivative function that is being generated. | ||
clang::FunctionDecl* m_Derivative; | ||
/// The function that is currently differentiated. | ||
const clang::FunctionDecl* m_Function; | ||
/// The differentiation request that is being currently processed. | ||
const DiffRequest& m_DiffReq; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member 'm_DiffReq' of type 'const DiffRequest &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members] const DiffRequest& m_DiffReq;
^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'm_DiffReq' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes] const DiffRequest& m_DiffReq;
^ |
||
DiffMode m_Mode; | ||
/// Map used to keep track of variable declarations and match them | ||
/// with their derivatives. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: m_Mode [cppcoreguidelines-pro-type-member-init]