-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[TARGETS-PARSER] Added const reference for params with size >= 16 bytes #125083
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 |
---|---|---|
|
@@ -121,7 +121,7 @@ class TailFoldingOption { | |
return Bits; | ||
} | ||
|
||
void reportError(std::string Opt) { | ||
void reportError(const std::string &Opt) { | ||
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 should probably be Twine or StringRef |
||
errs() << "invalid argument '" << Opt | ||
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 doesn't look like an OK error handling strategy though |
||
<< "' to -sve-tail-folding=; the option should be of the form\n" | ||
" (disabled|all|default|simple)[+(reductions|recurrences" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ namespace adjust { | |
using namespace llvm; | ||
|
||
static void unsigned_width(unsigned Width, uint64_t Value, | ||
std::string Description, const MCFixup &Fixup, | ||
const std::string &Description, const MCFixup &Fixup, | ||
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 should be using StringRef, and the code below should be using Twine instead of building the string itself |
||
MCContext *Ctx) { | ||
if (!isUIntN(Width, Value)) { | ||
std::string Diagnostic = "out of range " + Description; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1822,7 +1822,7 @@ void NVPTXAsmPrinter::printFPConstant(const ConstantFP *Fp, raw_ostream &O) { | |
} else | ||
llvm_unreachable("unsupported fp type"); | ||
|
||
APInt API = APF.bitcastToAPInt(); | ||
const APInt &API = APF.bitcastToAPInt(); | ||
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. bitcastToAPInt returns a new APInt not a reference. So this creates a reference to a temporary object which works but seems like an uneccessary change. |
||
O << lead << format_hex_no_prefix(API.getZExtValue(), numHex, /*Upper=*/true); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ void NVPTXFloatMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const { | |
break; | ||
} | ||
|
||
APInt API = APF.bitcastToAPInt(); | ||
const APInt &API = APF.bitcastToAPInt(); | ||
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. bitcastToAPInt returns a new APInt not a reference. |
||
OS << format_hex_no_prefix(API.getZExtValue(), NumHex, /*Upper=*/true); | ||
} | ||
|
||
|
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.
TargetRegisterClass certainly should never be passed by value. The actual pointer value is significant