[llvm] r283008 - Use StringRef in Pass Info/Support API (NFC)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 21:03:31 PDT 2016


Author: mehdi_amini
Date: Fri Sep 30 23:03:30 2016
New Revision: 283008

URL: http://llvm.org/viewvc/llvm-project?rev=283008&view=rev
Log:
Use StringRef in Pass Info/Support API (NFC)

Modified:
    llvm/trunk/include/llvm/PassInfo.h
    llvm/trunk/include/llvm/PassSupport.h
    llvm/trunk/lib/IR/Pass.cpp

Modified: llvm/trunk/include/llvm/PassInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassInfo.h?rev=283008&r1=283007&r2=283008&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassInfo.h (original)
+++ llvm/trunk/include/llvm/PassInfo.h Fri Sep 30 23:03:30 2016
@@ -15,6 +15,8 @@
 
 #include "llvm/ADT/StringRef.h"
 
+#include "llvm/ADT/StringRef.h"
+
 #include <cassert>
 #include <vector>
 
@@ -58,7 +60,7 @@ public:
   /// PassInfo ctor - Do not call this directly, this should only be invoked
   /// through RegisterPass. This version is for use by analysis groups; it
   /// does not auto-register the pass.
-  PassInfo(const char *name, const void *pi)
+  PassInfo(StringRef name, const void *pi)
       : PassName(name), PassArgument(""), PassID(pi), IsCFGOnlyPass(false),
         IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(nullptr),
         TargetMachineCtor(nullptr) {}

Modified: llvm/trunk/include/llvm/PassSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=283008&r1=283007&r2=283008&view=diff
==============================================================================
--- llvm/trunk/include/llvm/PassSupport.h (original)
+++ llvm/trunk/include/llvm/PassSupport.h Fri Sep 30 23:03:30 2016
@@ -101,7 +101,7 @@ template <typename PassName> Pass *callT
 ///
 template <typename passName> struct RegisterPass : public PassInfo {
   // Register Pass using default constructor...
-  RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false,
+  RegisterPass(StringRef PassArg, StringRef Name, bool CFGOnly = false,
                bool is_analysis = false)
       : PassInfo(Name, PassArg, &passName::ID,
                  PassInfo::NormalCtor_t(callDefaultCtor<passName>), CFGOnly,
@@ -131,7 +131,7 @@ template <typename passName> struct Regi
 ///
 class RegisterAGBase : public PassInfo {
 public:
-  RegisterAGBase(const char *Name, const void *InterfaceID,
+  RegisterAGBase(StringRef Name, const void *InterfaceID,
                  const void *PassID = nullptr, bool isDefault = false);
 };
 

Modified: llvm/trunk/lib/IR/Pass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Pass.cpp?rev=283008&r1=283007&r2=283008&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Pass.cpp (original)
+++ llvm/trunk/lib/IR/Pass.cpp Fri Sep 30 23:03:30 2016
@@ -218,7 +218,7 @@ Pass *Pass::createPass(AnalysisID ID) {
 
 // RegisterAGBase implementation
 //
-RegisterAGBase::RegisterAGBase(const char *Name, const void *InterfaceID,
+RegisterAGBase::RegisterAGBase(StringRef Name, const void *InterfaceID,
                                const void *PassID, bool isDefault)
     : PassInfo(Name, InterfaceID) {
   PassRegistry::getPassRegistry()->registerAnalysisGroup(InterfaceID, PassID,




More information about the llvm-commits mailing list