Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: src/PNaClTranslator.cpp

Issue 904783002: Subzero: Convert a few getName() methods to return a const string ref. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceOperand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index ce7e09c8cc7bcb9bcc0a870d50c8ec4fd0bf99f2..552ee6009622d22f676c174af3c6f3f33d6bbf7b 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -294,7 +294,7 @@ public:
const auto Var = llvm::cast<Ice::VariableDeclaration>(Decl);
IsUndefined = !Var->hasInitializer();
}
- std::string Name;
+ Ice::IceString Name;
bool SuppressMangling;
if (Decl) {
Name = Decl->getName();
@@ -1508,7 +1508,7 @@ private:
}
// Returns true if the Str begins with Prefix.
- bool isStringPrefix(Ice::IceString &Str, Ice::IceString &Prefix) {
+ bool isStringPrefix(const Ice::IceString &Str, const Ice::IceString &Prefix) {
const size_t PrefixSize = Prefix.size();
if (Str.size() < PrefixSize)
return false;
@@ -2446,7 +2446,7 @@ void FunctionParser::ProcessRecord() {
// Check if this direct call is to an Intrinsic (starts with "llvm.")
static Ice::IceString LLVMPrefix("llvm.");
- Ice::IceString Name = Fcn->getName();
+ const Ice::IceString &Name = Fcn->getName();
if (isStringPrefix(Name, LLVMPrefix)) {
Ice::IceString Suffix = Name.substr(LLVMPrefix.size());
IntrinsicInfo =
« no previous file with comments | « src/IceOperand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698