[llvm] r216820 - Fix some cases where StringRef was being passed by const reference. Remove const from some other StringRefs since its implicitly const already.

Craig Topper craig.topper at gmail.com
Sat Aug 30 10:08:47 PDT 2014


No technical problem, but the coding standards do say this "StringRef is
small and pervasive enough in LLVM that it should always be passed by
value."


On Sat, Aug 30, 2014 at 10:06 AM, Aaron Ballman <aaron at aaronballman.com>
wrote:

> On Sat, Aug 30, 2014 at 12:48 PM, Craig Topper <craig.topper at gmail.com>
> wrote:
> > Author: ctopper
> > Date: Sat Aug 30 11:48:02 2014
> > New Revision: 216820
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=216820&view=rev
> > Log:
> > Fix some cases where StringRef was being passed by const reference.
> Remove const from some other StringRefs since its implicitly const already.
>
> Just curious, but is there a technical problem with StringRef being
> passed by const reference?
>
> ~Aaron
>
> >
> > Modified:
> >     llvm/trunk/include/llvm/MC/MCDwarf.h
> >     llvm/trunk/include/llvm/MC/SubtargetFeature.h
> >     llvm/trunk/include/llvm/Support/Path.h
> >     llvm/trunk/include/llvm/Support/SpecialCaseList.h
> >     llvm/trunk/include/llvm/Target/TargetMachine.h
> >     llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h
> >     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
> >     llvm/trunk/lib/MC/SubtargetFeature.cpp
> >     llvm/trunk/lib/Support/Path.cpp
> >     llvm/trunk/lib/Support/SpecialCaseList.cpp
> >     llvm/trunk/lib/Support/YAMLParser.cpp
> >     llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
> >     llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
> >     llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
> >     llvm/trunk/lib/Target/Mips/MipsISelLowering.h
> >     llvm/trunk/lib/Target/Mips/MipsMachineFunction.cpp
> >     llvm/trunk/lib/Target/Mips/MipsMachineFunction.h
> >     llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp
> >     llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.h
> >     llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
> >     llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
> >
> > Modified: llvm/trunk/include/llvm/MC/MCDwarf.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCDwarf.h?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/include/llvm/MC/MCDwarf.h (original)
> > +++ llvm/trunk/include/llvm/MC/MCDwarf.h Sat Aug 30 11:48:02 2014
> > @@ -457,7 +457,7 @@ public:
> >      return Offset;
> >    }
> >
> > -  const StringRef getValues() const {
> > +  StringRef getValues() const {
> >      assert(Operation == OpEscape);
> >      return StringRef(&Values[0], Values.size());
> >    }
> >
> > Modified: llvm/trunk/include/llvm/MC/SubtargetFeature.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/SubtargetFeature.h?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/include/llvm/MC/SubtargetFeature.h (original)
> > +++ llvm/trunk/include/llvm/MC/SubtargetFeature.h Sat Aug 30 11:48:02
> 2014
> > @@ -72,21 +72,21 @@ struct SubtargetInfoKV {
> >  class SubtargetFeatures {
> >    std::vector<std::string> Features;    // Subtarget features as a
> vector
> >  public:
> > -  explicit SubtargetFeatures(const StringRef Initial = "");
> > +  explicit SubtargetFeatures(StringRef Initial = "");
> >
> >    /// Features string accessors.
> >    std::string getString() const;
> >
> >    /// Adding Features.
> > -  void AddFeature(const StringRef String);
> > +  void AddFeature(StringRef String);
> >
> >    /// ToggleFeature - Toggle a feature and returns the newly updated
> feature
> >    /// bits.
> > -  uint64_t ToggleFeature(uint64_t Bits, const StringRef String,
> > +  uint64_t ToggleFeature(uint64_t Bits, StringRef String,
> >                           ArrayRef<SubtargetFeatureKV> FeatureTable);
> >
> >    /// Get feature bits of a CPU.
> > -  uint64_t getFeatureBits(const StringRef CPU,
> > +  uint64_t getFeatureBits(StringRef CPU,
> >                            ArrayRef<SubtargetFeatureKV> CPUTable,
> >                            ArrayRef<SubtargetFeatureKV> FeatureTable);
> >
> >
> > Modified: llvm/trunk/include/llvm/Support/Path.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Path.h?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/include/llvm/Support/Path.h (original)
> > +++ llvm/trunk/include/llvm/Support/Path.h Sat Aug 30 11:48:02 2014
> > @@ -204,7 +204,7 @@ void native(SmallVectorImpl<char> &path)
> >  ///
> >  /// @param path Input path.
> >  /// @result The root name of \a path if it has one, otherwise "".
> > -const StringRef root_name(StringRef path);
> > +StringRef root_name(StringRef path);
> >
> >  /// @brief Get root directory.
> >  ///
> > @@ -217,7 +217,7 @@ const StringRef root_name(StringRef path
> >  /// @param path Input path.
> >  /// @result The root directory of \a path if it has one, otherwise
> >  ///               "".
> > -const StringRef root_directory(StringRef path);
> > +StringRef root_directory(StringRef path);
> >
> >  /// @brief Get root path.
> >  ///
> > @@ -225,7 +225,7 @@ const StringRef root_directory(StringRef
> >  ///
> >  /// @param path Input path.
> >  /// @result The root path of \a path if it has one, otherwise "".
> > -const StringRef root_path(StringRef path);
> > +StringRef root_path(StringRef path);
> >
> >  /// @brief Get relative path.
> >  ///
> > @@ -237,7 +237,7 @@ const StringRef root_path(StringRef path
> >  ///
> >  /// @param path Input path.
> >  /// @result The path starting after root_path if one exists, otherwise
> "".
> > -const StringRef relative_path(StringRef path);
> > +StringRef relative_path(StringRef path);
> >
> >  /// @brief Get parent path.
> >  ///
> > @@ -249,7 +249,7 @@ const StringRef relative_path(StringRef
> >  ///
> >  /// @param path Input path.
> >  /// @result The parent path of \a path if one exists, otherwise "".
> > -const StringRef parent_path(StringRef path);
> > +StringRef parent_path(StringRef path);
> >
> >  /// @brief Get filename.
> >  ///
> > @@ -263,7 +263,7 @@ const StringRef parent_path(StringRef pa
> >  /// @param path Input path.
> >  /// @result The filename part of \a path. This is defined as the last
> component
> >  ///         of \a path.
> > -const StringRef filename(StringRef path);
> > +StringRef filename(StringRef path);
> >
> >  /// @brief Get stem.
> >  ///
> > @@ -281,7 +281,7 @@ const StringRef filename(StringRef path)
> >  ///
> >  /// @param path Input path.
> >  /// @result The stem of \a path.
> > -const StringRef stem(StringRef path);
> > +StringRef stem(StringRef path);
> >
> >  /// @brief Get extension.
> >  ///
> > @@ -297,7 +297,7 @@ const StringRef stem(StringRef path);
> >  ///
> >  /// @param path Input path.
> >  /// @result The extension of \a path.
> > -const StringRef extension(StringRef path);
> > +StringRef extension(StringRef path);
> >
> >  /// @brief Check whether the given char is a path separator on the host
> OS.
> >  ///
> > @@ -308,7 +308,7 @@ bool is_separator(char value);
> >  /// @brief Return the preferred separator for this platform.
> >  ///
> >  /// @result StringRef of the preferred separator, null-terminated.
> > -const StringRef get_separator();
> > +StringRef get_separator();
> >
> >  /// @brief Get the typical temporary directory for the system, e.g.,
> >  /// "/var/tmp" or "C:/TEMP"
> >
> > Modified: llvm/trunk/include/llvm/Support/SpecialCaseList.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/SpecialCaseList.h?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/include/llvm/Support/SpecialCaseList.h (original)
> > +++ llvm/trunk/include/llvm/Support/SpecialCaseList.h Sat Aug 30
> 11:48:02 2014
> > @@ -60,13 +60,13 @@ class SpecialCaseList {
> >    /// Parses the special case list from a file. If Path is empty,
> returns
> >    /// an empty special case list. On failure, returns 0 and writes an
> error
> >    /// message to string.
> > -  static SpecialCaseList *create(const StringRef Path, std::string
> &Error);
> > +  static SpecialCaseList *create(StringRef Path, std::string &Error);
> >    /// Parses the special case list from a memory buffer. On failure,
> returns
> >    /// 0 and writes an error message to string.
> >    static SpecialCaseList *create(const MemoryBuffer *MB, std::string
> &Error);
> >    /// Parses the special case list from a file. On failure, reports a
> fatal
> >    /// error.
> > -  static SpecialCaseList *createOrDie(const StringRef Path);
> > +  static SpecialCaseList *createOrDie(StringRef Path);
> >
> >    ~SpecialCaseList();
> >
> > @@ -75,8 +75,8 @@ class SpecialCaseList {
> >    ///   @Section:<E>=@Category
> >    /// \endcode
> >    /// and @Query satisfies a wildcard expression <E>.
> > -  bool inSection(const StringRef Section, const StringRef Query,
> > -                 const StringRef Category = StringRef()) const;
> > +  bool inSection(StringRef Section, StringRef Query,
> > +                 StringRef Category = StringRef()) const;
> >
> >   private:
> >    SpecialCaseList(SpecialCaseList const &) LLVM_DELETED_FUNCTION;
> >
> > Modified: llvm/trunk/include/llvm/Target/TargetMachine.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/include/llvm/Target/TargetMachine.h (original)
> > +++ llvm/trunk/include/llvm/Target/TargetMachine.h Sat Aug 30 11:48:02
> 2014
> > @@ -92,9 +92,9 @@ public:
> >
> >    const Target &getTarget() const { return TheTarget; }
> >
> > -  const StringRef getTargetTriple() const { return TargetTriple; }
> > -  const StringRef getTargetCPU() const { return TargetCPU; }
> > -  const StringRef getTargetFeatureString() const { return TargetFS; }
> > +  StringRef getTargetTriple() const { return TargetTriple; }
> > +  StringRef getTargetCPU() const { return TargetCPU; }
> > +  StringRef getTargetFeatureString() const { return TargetFS; }
> >
> >    /// getSubtargetImpl - virtual method implemented by subclasses that
> returns
> >    /// a reference to that target's TargetSubtargetInfo-derived member
> variable.
> >
> > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h (original)
> > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h Sat Aug 30 11:48:02 2014
> > @@ -381,10 +381,10 @@ public:
> >  ///
> >  class DIEString : public DIEValue {
> >    const DIEValue *Access;
> > -  const StringRef Str;
> > +  StringRef Str;
> >
> >  public:
> > -  DIEString(const DIEValue *Acc, const StringRef S)
> > +  DIEString(const DIEValue *Acc, StringRef S)
> >        : DIEValue(isString), Access(Acc), Str(S) {}
> >
> >    /// getString - Grab the string out of the object.
> >
> > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
> > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Sat Aug 30 11:48:02
> 2014
> > @@ -275,11 +275,11 @@ public:
> >    void addSInt(DIELoc &Die, Optional<dwarf::Form> Form, int64_t
> Integer);
> >
> >    /// addString - Add a string attribute data and value.
> > -  void addString(DIE &Die, dwarf::Attribute Attribute, const StringRef
> Str);
> > +  void addString(DIE &Die, dwarf::Attribute Attribute, StringRef Str);
> >
> >    /// addLocalString - Add a string attribute data and value.
> >    void addLocalString(DIE &Die, dwarf::Attribute Attribute,
> > -                      const StringRef Str);
> > +                      StringRef Str);
> >
> >    /// addExpr - Add a Dwarf expression attribute data and value.
> >    void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr);
> >
> > Modified: llvm/trunk/lib/MC/SubtargetFeature.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/SubtargetFeature.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/MC/SubtargetFeature.cpp (original)
> > +++ llvm/trunk/lib/MC/SubtargetFeature.cpp Sat Aug 30 11:48:02 2014
> > @@ -27,7 +27,7 @@ using namespace llvm;
> >
> >  /// hasFlag - Determine if a feature has a flag; '+' or '-'
> >  ///
> > -static inline bool hasFlag(const StringRef Feature) {
> > +static inline bool hasFlag(StringRef Feature) {
> >    assert(!Feature.empty() && "Empty string");
> >    // Get first character
> >    char Ch = Feature[0];
> > @@ -37,13 +37,13 @@ static inline bool hasFlag(const StringR
> >
> >  /// StripFlag - Return string stripped of flag.
> >  ///
> > -static inline std::string StripFlag(const StringRef Feature) {
> > +static inline std::string StripFlag(StringRef Feature) {
> >    return hasFlag(Feature) ? Feature.substr(1) : Feature;
> >  }
> >
> >  /// isEnabled - Return true if enable flag; '+'.
> >  ///
> > -static inline bool isEnabled(const StringRef Feature) {
> > +static inline bool isEnabled(StringRef Feature) {
> >    assert(!Feature.empty() && "Empty string");
> >    // Get first character
> >    char Ch = Feature[0];
> > @@ -53,7 +53,7 @@ static inline bool isEnabled(const Strin
> >
> >  /// Split - Splits a string of comma separated items in to a vector of
> strings.
> >  ///
> > -static void Split(std::vector<std::string> &V, const StringRef S) {
> > +static void Split(std::vector<std::string> &V, StringRef S) {
> >    SmallVector<StringRef, 3> Tmp;
> >    S.split(Tmp, ",", -1, false /* KeepEmpty */);
> >    V.assign(Tmp.begin(), Tmp.end());
> > @@ -81,7 +81,7 @@ static std::string Join(const std::vecto
> >  }
> >
> >  /// Adding features.
> > -void SubtargetFeatures::AddFeature(const StringRef String) {
> > +void SubtargetFeatures::AddFeature(StringRef String) {
> >    // Don't add empty features or features we already have.
> >    if (!String.empty())
> >      // Convert to lowercase, prepend flag if we don't already have a
> flag.
> > @@ -136,7 +136,7 @@ static void Help(ArrayRef<SubtargetFeatu
> >  //                    SubtargetFeatures Implementation
> >
> //===----------------------------------------------------------------------===//
> >
> > -SubtargetFeatures::SubtargetFeatures(const StringRef Initial) {
> > +SubtargetFeatures::SubtargetFeatures(StringRef Initial) {
> >    // Break up string into separate features
> >    Split(Features, Initial);
> >  }
> > @@ -181,7 +181,7 @@ void ClearImpliedBits(uint64_t &Bits, co
> >  /// ToggleFeature - Toggle a feature and returns the newly updated
> feature
> >  /// bits.
> >  uint64_t
> > -SubtargetFeatures::ToggleFeature(uint64_t Bits, const StringRef Feature,
> > +SubtargetFeatures::ToggleFeature(uint64_t Bits, StringRef Feature,
> >                                   ArrayRef<SubtargetFeatureKV>
> FeatureTable) {
> >
> >    // Find feature in table.
> > @@ -213,7 +213,7 @@ SubtargetFeatures::ToggleFeature(uint64_
> >  /// getFeatureBits - Get feature bits a CPU.
> >  ///
> >  uint64_t
> > -SubtargetFeatures::getFeatureBits(const StringRef CPU,
> > +SubtargetFeatures::getFeatureBits(StringRef CPU,
> >                                    ArrayRef<SubtargetFeatureKV> CPUTable,
> >                                    ArrayRef<SubtargetFeatureKV>
> FeatureTable) {
> >
> >
> > Modified: llvm/trunk/lib/Support/Path.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Support/Path.cpp (original)
> > +++ llvm/trunk/lib/Support/Path.cpp Sat Aug 30 11:48:02 2014
> > @@ -359,7 +359,7 @@ bool reverse_iterator::operator==(const
> >           Position == RHS.Position;
> >  }
> >
> > -const StringRef root_path(StringRef path) {
> > +StringRef root_path(StringRef path) {
> >    const_iterator b = begin(path),
> >                   pos = b,
> >                   e = end(path);
> > @@ -391,7 +391,7 @@ const StringRef root_path(StringRef path
> >    return StringRef();
> >  }
> >
> > -const StringRef root_name(StringRef path) {
> > +StringRef root_name(StringRef path) {
> >    const_iterator b = begin(path),
> >                   e = end(path);
> >    if (b != e) {
> > @@ -413,7 +413,7 @@ const StringRef root_name(StringRef path
> >    return StringRef();
> >  }
> >
> > -const StringRef root_directory(StringRef path) {
> > +StringRef root_directory(StringRef path) {
> >    const_iterator b = begin(path),
> >                   pos = b,
> >                   e = end(path);
> > @@ -442,7 +442,7 @@ const StringRef root_directory(StringRef
> >    return StringRef();
> >  }
> >
> > -const StringRef relative_path(StringRef path) {
> > +StringRef relative_path(StringRef path) {
> >    StringRef root = root_path(path);
> >    return path.substr(root.size());
> >  }
> > @@ -494,7 +494,7 @@ void append(SmallVectorImpl<char> &path,
> >      path::append(path, *begin);
> >  }
> >
> > -const StringRef parent_path(StringRef path) {
> > +StringRef parent_path(StringRef path) {
> >    size_t end_pos = parent_path_end(path);
> >    if (end_pos == StringRef::npos)
> >      return StringRef();
> > @@ -552,11 +552,11 @@ void native(SmallVectorImpl<char> &Path)
> >  #endif
> >  }
> >
> > -const StringRef filename(StringRef path) {
> > +StringRef filename(StringRef path) {
> >    return *rbegin(path);
> >  }
> >
> > -const StringRef stem(StringRef path) {
> > +StringRef stem(StringRef path) {
> >    StringRef fname = filename(path);
> >    size_t pos = fname.find_last_of('.');
> >    if (pos == StringRef::npos)
> > @@ -569,7 +569,7 @@ const StringRef stem(StringRef path) {
> >        return fname.substr(0, pos);
> >  }
> >
> > -const StringRef extension(StringRef path) {
> > +StringRef extension(StringRef path) {
> >    StringRef fname = filename(path);
> >    size_t pos = fname.find_last_of('.');
> >    if (pos == StringRef::npos)
> > @@ -594,7 +594,7 @@ bool is_separator(char value) {
> >
> >  static const char preferred_separator_string[] = { preferred_separator,
> '\0' };
> >
> > -const StringRef get_separator() {
> > +StringRef get_separator() {
> >    return preferred_separator_string;
> >  }
> >
> >
> > Modified: llvm/trunk/lib/Support/SpecialCaseList.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SpecialCaseList.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Support/SpecialCaseList.cpp (original)
> > +++ llvm/trunk/lib/Support/SpecialCaseList.cpp Sat Aug 30 11:48:02 2014
> > @@ -48,8 +48,7 @@ struct SpecialCaseList::Entry {
> >
> >  SpecialCaseList::SpecialCaseList() : Entries() {}
> >
> > -SpecialCaseList *SpecialCaseList::create(
> > -    const StringRef Path, std::string &Error) {
> > +SpecialCaseList *SpecialCaseList::create(StringRef Path, std::string
> &Error) {
> >    if (Path.empty())
> >      return new SpecialCaseList();
> >    ErrorOr<std::unique_ptr<MemoryBuffer>> FileOrErr =
> > @@ -69,7 +68,7 @@ SpecialCaseList *SpecialCaseList::create
> >    return SCL.release();
> >  }
> >
> > -SpecialCaseList *SpecialCaseList::createOrDie(const StringRef Path) {
> > +SpecialCaseList *SpecialCaseList::createOrDie(StringRef Path) {
> >    std::string Error;
> >    if (SpecialCaseList *SCL = create(Path, Error))
> >      return SCL;
> > @@ -157,8 +156,8 @@ bool SpecialCaseList::parse(const Memory
> >
> >  SpecialCaseList::~SpecialCaseList() {}
> >
> > -bool SpecialCaseList::inSection(const StringRef Section, const
> StringRef Query,
> > -                                const StringRef Category) const {
> > +bool SpecialCaseList::inSection(StringRef Section, StringRef Query,
> > +                                StringRef Category) const {
> >    StringMap<StringMap<Entry> >::const_iterator I =
> Entries.find(Section);
> >    if (I == Entries.end()) return false;
> >    StringMap<Entry>::const_iterator II = I->second.find(Category);
> >
> > Modified: llvm/trunk/lib/Support/YAMLParser.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLParser.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Support/YAMLParser.cpp (original)
> > +++ llvm/trunk/lib/Support/YAMLParser.cpp Sat Aug 30 11:48:02 2014
> > @@ -259,7 +259,7 @@ namespace yaml {
> >  /// @brief Scans YAML tokens from a MemoryBuffer.
> >  class Scanner {
> >  public:
> > -  Scanner(const StringRef Input, SourceMgr &SM);
> > +  Scanner(StringRef Input, SourceMgr &SM);
> >    Scanner(MemoryBufferRef Buffer, SourceMgr &SM_);
> >
> >    /// @brief Parse the next token and return it without popping it.
> >
> > Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp (original)
> > +++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Sat Aug 30
> 11:48:02 2014
> > @@ -44,7 +44,7 @@ class ARMAsmBackend : public MCAsmBacken
> >    bool isThumbMode;     // Currently emitting Thumb code.
> >    bool IsLittleEndian;  // Big or little endian.
> >  public:
> > -  ARMAsmBackend(const Target &T, const StringRef TT, bool IsLittle)
> > +  ARMAsmBackend(const Target &T, StringRef TT, bool IsLittle)
> >      : MCAsmBackend(), STI(ARM_MC::createARMMCSubtargetInfo(TT, "", "")),
> >        isThumbMode(TT.startswith("thumb")), IsLittleEndian(IsLittle) {}
> >
> > @@ -761,7 +761,7 @@ namespace {
> >  // FIXME: This should be in a separate file.
> >  class ARMWinCOFFAsmBackend : public ARMAsmBackend {
> >  public:
> > -  ARMWinCOFFAsmBackend(const Target &T, const StringRef &Triple)
> > +  ARMWinCOFFAsmBackend(const Target &T, StringRef Triple)
> >      : ARMAsmBackend(T, Triple, true) { }
> >    MCObjectWriter *createObjectWriter(raw_ostream &OS) const override {
> >      return createARMWinCOFFObjectWriter(OS, /*Is64Bit=*/false);
> > @@ -773,7 +773,7 @@ public:
> >  class ELFARMAsmBackend : public ARMAsmBackend {
> >  public:
> >    uint8_t OSABI;
> > -  ELFARMAsmBackend(const Target &T, const StringRef TT,
> > +  ELFARMAsmBackend(const Target &T, StringRef TT,
> >                     uint8_t OSABI, bool IsLittle)
> >      : ARMAsmBackend(T, TT, IsLittle), OSABI(OSABI) { }
> >
> > @@ -786,7 +786,7 @@ public:
> >  class DarwinARMAsmBackend : public ARMAsmBackend {
> >  public:
> >    const MachO::CPUSubTypeARM Subtype;
> > -  DarwinARMAsmBackend(const Target &T, const StringRef TT,
> > +  DarwinARMAsmBackend(const Target &T, StringRef TT,
> >                        MachO::CPUSubTypeARM st)
> >      : ARMAsmBackend(T, TT, /* IsLittleEndian */ true), Subtype(st) {
> >        HasDataInCodeSupport = true;
> >
> > Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
> > +++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Sat Aug 30
> 11:48:02 2014
> > @@ -2081,7 +2081,7 @@ bool MipsAsmParser::searchSymbolAlias(Op
> >        return false;
> >      if (Expr->getKind() == MCExpr::SymbolRef) {
> >        const MCSymbolRefExpr *Ref = static_cast<const MCSymbolRefExpr
> *>(Expr);
> > -      const StringRef DefSymbol = Ref->getSymbol().getName();
> > +      StringRef DefSymbol = Ref->getSymbol().getName();
> >        if (DefSymbol.startswith("$")) {
> >          OperandMatchResultTy ResTy =
> >              MatchAnyRegisterNameWithoutDollar(Operands,
> DefSymbol.substr(1), S);
> >
> > Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
> > +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Sat Aug 30 11:48:02
> 2014
> > @@ -3034,7 +3034,7 @@ MipsTargetLowering::getSingleConstraintM
> >  /// that is returned indicates whether parsing was successful. The
> second flag
> >  /// is true if the numeric part exists.
> >  static std::pair<bool, bool>
> > -parsePhysicalReg(const StringRef &C, std::string &Prefix,
> > +parsePhysicalReg(StringRef C, std::string &Prefix,
> >                   unsigned long long &Reg) {
> >    if (C.front() != '{' || C.back() != '}')
> >      return std::make_pair(false, false);
> > @@ -3055,7 +3055,7 @@ parsePhysicalReg(const StringRef &C, std
> >  }
> >
> >  std::pair<unsigned, const TargetRegisterClass *> MipsTargetLowering::
> > -parseRegForInlineAsmConstraint(const StringRef &C, MVT VT) const {
> > +parseRegForInlineAsmConstraint(StringRef C, MVT VT) const {
> >    const TargetRegisterInfo *TRI =
> >        getTargetMachine().getSubtargetImpl()->getRegisterInfo();
> >    const TargetRegisterClass *RC;
> >
> > Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.h?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/Mips/MipsISelLowering.h (original)
> > +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.h Sat Aug 30 11:48:02
> 2014
> > @@ -563,7 +563,7 @@ namespace llvm {
> >      /// This function parses registers that appear in inline-asm
> constraints.
> >      /// It returns pair (0, 0) on failure.
> >      std::pair<unsigned, const TargetRegisterClass *>
> > -    parseRegForInlineAsmConstraint(const StringRef &C, MVT VT) const;
> > +    parseRegForInlineAsmConstraint(StringRef C, MVT VT) const;
> >
> >      std::pair<unsigned, const TargetRegisterClass*>
> >                getRegForInlineAsmConstraint(const std::string
> &Constraint,
> >
> > Modified: llvm/trunk/lib/Target/Mips/MipsMachineFunction.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsMachineFunction.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/Mips/MipsMachineFunction.cpp (original)
> > +++ llvm/trunk/lib/Target/Mips/MipsMachineFunction.cpp Sat Aug 30
> 11:48:02 2014
> > @@ -24,7 +24,7 @@ FixGlobalBaseReg("mips-fix-global-base-r
> >                   cl::desc("Always use $gp as the global base
> register."));
> >
> >  // class MipsCallEntry.
> > -MipsCallEntry::MipsCallEntry(const StringRef &N) {
> > +MipsCallEntry::MipsCallEntry(StringRef N) {
> >  #ifndef NDEBUG
> >    Name = N;
> >    Val = nullptr;
> > @@ -119,7 +119,7 @@ bool MipsFunctionInfo::isEhDataRegFI(int
> >                          || FI == EhDataRegFI[2] || FI ==
> EhDataRegFI[3]);
> >  }
> >
> > -MachinePointerInfo MipsFunctionInfo::callPtrInfo(const StringRef &Name)
> {
> > +MachinePointerInfo MipsFunctionInfo::callPtrInfo(StringRef Name) {
> >    const MipsCallEntry *&E = ExternalCallEntries[Name];
> >
> >    if (!E)
> >
> > Modified: llvm/trunk/lib/Target/Mips/MipsMachineFunction.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsMachineFunction.h?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/Mips/MipsMachineFunction.h (original)
> > +++ llvm/trunk/lib/Target/Mips/MipsMachineFunction.h Sat Aug 30 11:48:02
> 2014
> > @@ -34,7 +34,7 @@ namespace llvm {
> >  /// resolved by lazy-binding.
> >  class MipsCallEntry : public PseudoSourceValue {
> >  public:
> > -  explicit MipsCallEntry(const StringRef &N);
> > +  explicit MipsCallEntry(StringRef N);
> >    explicit MipsCallEntry(const GlobalValue *V);
> >    bool isConstant(const MachineFrameInfo *) const override;
> >    bool isAliased(const MachineFrameInfo *) const override;
> > @@ -88,7 +88,7 @@ public:
> >
> >    /// \brief Create a MachinePointerInfo that has a MipsCallEntr object
> >    /// representing a GOT entry for an external function.
> > -  MachinePointerInfo callPtrInfo(const StringRef &Name);
> > +  MachinePointerInfo callPtrInfo(StringRef Name);
> >
> >    /// \brief Create a MachinePointerInfo that has a MipsCallEntr object
> >    /// representing a GOT entry for a global function.
> >
> > Modified: llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp
> (original)
> > +++ llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp Sat Aug
> 30 11:48:02 2014
> > @@ -25,7 +25,7 @@ static cl::opt<bool> CompileForDebugging
> >
> >  void NVPTXMCAsmInfo::anchor() {}
> >
> > -NVPTXMCAsmInfo::NVPTXMCAsmInfo(const StringRef &TT) {
> > +NVPTXMCAsmInfo::NVPTXMCAsmInfo(StringRef TT) {
> >    Triple TheTriple(TT);
> >    if (TheTriple.getArch() == Triple::nvptx64) {
> >      PointerSize = CalleeSaveStackSlotSize = 8;
> >
> > Modified: llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.h?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.h (original)
> > +++ llvm/trunk/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.h Sat Aug 30
> 11:48:02 2014
> > @@ -23,7 +23,7 @@ class StringRef;
> >  class NVPTXMCAsmInfo : public MCAsmInfo {
> >    virtual void anchor();
> >  public:
> > -  explicit NVPTXMCAsmInfo(const StringRef &TT);
> > +  explicit NVPTXMCAsmInfo(StringRef TT);
> >  };
> >  } // namespace llvm
> >
> >
> > Modified: llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
> (original)
> > +++ llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp Sat
> Aug 30 11:48:02 2014
> > @@ -143,7 +143,7 @@ class DFSanABIList {
> >
> >    /// Returns whether either this function or its source file are
> listed in the
> >    /// given category.
> > -  bool isIn(const Function &F, const StringRef Category) const {
> > +  bool isIn(const Function &F, StringRef Category) const {
> >      return isIn(*F.getParent(), Category) ||
> >             SCL->inSection("fun", F.getName(), Category);
> >    }
> > @@ -152,7 +152,7 @@ class DFSanABIList {
> >    ///
> >    /// If GA aliases a function, the alias's name is matched as a
> function name
> >    /// would be.  Similarly, aliases of globals are matched like globals.
> > -  bool isIn(const GlobalAlias &GA, const StringRef Category) const {
> > +  bool isIn(const GlobalAlias &GA, StringRef Category) const {
> >      if (isIn(*GA.getParent(), Category))
> >        return true;
> >
> > @@ -164,7 +164,7 @@ class DFSanABIList {
> >    }
> >
> >    /// Returns whether this module is listed in the given category.
> > -  bool isIn(const Module &M, const StringRef Category) const {
> > +  bool isIn(const Module &M, StringRef Category) const {
> >      return SCL->inSection("src", M.getModuleIdentifier(), Category);
> >    }
> >  };
> >
> > Modified: llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp?rev=216820&r1=216819&r2=216820&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp (original)
> > +++ llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp Sat Aug 30
> 11:48:02 2014
> > @@ -65,7 +65,7 @@ DumpType("debug-dump", cl::init(DIDT_All
> >          clEnumValN(DIDT_StrOffsetsDwo, "str_offsets.dwo",
> ".debug_str_offsets.dwo"),
> >          clEnumValEnd));
> >
> > -static void DumpInput(const StringRef &Filename) {
> > +static void DumpInput(StringRef Filename) {
> >    ErrorOr<std::unique_ptr<MemoryBuffer>> BuffOrErr =
> >        MemoryBuffer::getFileOrSTDIN(Filename);
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140830/56327bda/attachment.html>


More information about the llvm-commits mailing list