Author: Simon Pilgrim Date: 2021-01-06T14:22:03Z New Revision: 396dd6cd3d8bdcda9dcb606ad4c054560bf0649f
URL: https://github.com/llvm/llvm-project/commit/396dd6cd3d8bdcda9dcb606ad4c054560bf0649f DIFF: https://github.com/llvm/llvm-project/commit/396dd6cd3d8bdcda9dcb606ad4c054560bf0649f.diff LOG: [ProfileData] Pass Twine by const reference instead of by value. Its only used by DiagnosticInfoSampleProfile which takes a const reference anyhow. Added: Modified: llvm/include/llvm/ProfileData/SampleProfReader.h Removed: ################################################################################ diff --git a/llvm/include/llvm/ProfileData/SampleProfReader.h b/llvm/include/llvm/ProfileData/SampleProfReader.h index 35e71f336c27..92fe825beefc 100644 --- a/llvm/include/llvm/ProfileData/SampleProfReader.h +++ b/llvm/include/llvm/ProfileData/SampleProfReader.h @@ -226,7 +226,6 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" -#include "llvm/ADT/Twine.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/Function.h" #include "llvm/IR/LLVMContext.h" @@ -247,6 +246,7 @@ namespace llvm { class raw_ostream; +class Twine; namespace sampleprof { @@ -408,7 +408,7 @@ class SampleProfileReader { StringMap<FunctionSamples> &getProfiles() { return Profiles; } /// Report a parse error message. - void reportError(int64_t LineNumber, Twine Msg) const { + void reportError(int64_t LineNumber, const Twine &Msg) const { Ctx.diagnose(DiagnosticInfoSampleProfile(Buffer->getBufferIdentifier(), LineNumber, Msg)); } _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits