-
Notifications
You must be signed in to change notification settings - Fork 769
[NFC][SYCL] Fix -Wreorder warning about order of initialization #3660
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
Conversation
Inside LoopAttributes::LoopAttributes(bool IsParallel) in CGLoopInfo.cpp file, SYCLIntelFPGAVariantCount is initialized after SYCLSpeculatedIterationsNIterations. Change the order of declaration of these data members to avoid a -Wreorder warning. Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
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.
Why is it being initialized at all in the ctor? This is a SmallVector
which default constructs just fine, but the constructor init list says SYCLIntelFPGAVariantCount(false)
and I have no idea what that even does. :-D I think the correct fix is to remove the initialization from the ctor init list.
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
Signed-off-by: Soumi Manna <soumi.manna@intel.com>
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.
LGTM!
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.
Thanks!
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.
LGTM
Inside LoopAttributes::LoopAttributes(bool IsParallel) in CGLoopInfo.cpp file,
SYCLIntelFPGAVariantCount is initialized after SYCLSpeculatedIterationsNIterations.
/// Value for count variant (min/max/avg) and count metadata.
llvm::SmallVector<std::pair<const char *, unsigned int>, 2>
SYCLIntelFPGAVariantCount;
This patch removes the initialization from the ctor init list to avoid a -Wreorder warning since SYCLIntelFPGAVariantCount is defined as SmallVector which default constructs just fine here.