-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[NFC][LLVM] Fix some llvm
namespace usage in Bitcode writer
#141709
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
base: main
Are you sure you want to change the base?
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 |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
#include "llvm/ADT/SmallVector.h" | ||
#include "llvm/ADT/StringMap.h" | ||
#include "llvm/ADT/StringRef.h" | ||
#include "llvm/Analysis/ModuleSummaryAnalysis.h" | ||
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. I'm not sure including an additional header is superior to just including the extern here below - why make this change? 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. This is an attempt to apply https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions to variables as well. I have another PR for the coding standard change (not yet approved). Also, the idea that there is just one declaration in a header shared by all who access that variables. 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. Thanks for the background. I'm not sure how I feel about going through and changing all of these as I think it will cause a lot of churn and add compile time. Let's wait to see if the coding standard change is accepted. |
||
#include "llvm/BinaryFormat/Dwarf.h" | ||
#include "llvm/Bitcode/BitcodeCommon.h" | ||
#include "llvm/Bitcode/BitcodeReader.h" | ||
|
@@ -117,10 +118,6 @@ static cl::opt<bool> | |
#endif | ||
cl::desc("")); | ||
|
||
namespace llvm { | ||
extern FunctionSummary::ForceSummaryHotnessType ForceSummaryEdgesCold; | ||
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. I suppose this could be simplified to "extern llvm::FunctionSummary::..." like the extern llvm::cl::opt below, if we decide to keep it. 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. Unfortunately, that does not work. Note in the case below, llvm:: is for the type. Here we want to declare an extern variable in the llvm namespace, and |
||
} | ||
|
||
extern llvm::cl::opt<bool> UseNewDbgInfoFormat; | ||
|
||
namespace { | ||
|
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.
This one is unrelated to the other changes and can be split into a separate PR and committed. There is a use of Argument in this file, but presumably it is being pulled in via other headers, so no need for this forward def.