diff options
| author | Daniel Sanders <daniel.sanders@imgtec.com> | 2015-06-10 12:11:26 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2015-06-10 12:11:26 +0000 |
| commit | a73f1fdb196758c93434e783c627e724b6d30f9a (patch) | |
| tree | 835c633abd294f03b00a1b7df7594082be39924f /llvm/include | |
| parent | 70e9f5fcb3f757a5e4f6f712cce8ef72d9f61003 (diff) | |
| download | bcm5719-llvm-a73f1fdb196758c93434e783c627e724b6d30f9a.tar.gz bcm5719-llvm-a73f1fdb196758c93434e783c627e724b6d30f9a.zip | |
Replace string GNU Triples with llvm::Triple in MCSubtargetInfo and create*MCSubtargetInfo(). NFC.
Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.
Reviewers: rafael
Reviewed By: rafael
Subscribers: rafael, ted, jfb, llvm-commits, rengolin, jholewinski
Differential Revision: http://reviews.llvm.org/D10311
llvm-svn: 239467
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/MC/MCSubtargetInfo.h | 11 | ||||
| -rw-r--r-- | llvm/include/llvm/Support/TargetRegistry.h | 10 |
2 files changed, 9 insertions, 12 deletions
diff --git a/llvm/include/llvm/MC/MCSubtargetInfo.h b/llvm/include/llvm/MC/MCSubtargetInfo.h index ee5d56334a2..b8ad02fbe69 100644 --- a/llvm/include/llvm/MC/MCSubtargetInfo.h +++ b/llvm/include/llvm/MC/MCSubtargetInfo.h @@ -27,7 +27,7 @@ class StringRef; /// MCSubtargetInfo - Generic base class for all target subtargets. /// class MCSubtargetInfo { - std::string TargetTriple; // Target triple + Triple TargetTriple; // Target triple std::string CPU; // CPU being targeted. ArrayRef<SubtargetFeatureKV> ProcFeatures; // Processor feature list ArrayRef<SubtargetFeatureKV> ProcDesc; // Processor descriptions @@ -45,20 +45,17 @@ class MCSubtargetInfo { FeatureBitset FeatureBits; // Feature bits for current CPU + FS public: - void InitMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS, + void InitMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS, ArrayRef<SubtargetFeatureKV> PF, ArrayRef<SubtargetFeatureKV> PD, const SubtargetInfoKV *ProcSched, const MCWriteProcResEntry *WPR, const MCWriteLatencyEntry *WL, - const MCReadAdvanceEntry *RA, - const InstrStage *IS, + const MCReadAdvanceEntry *RA, const InstrStage *IS, const unsigned *OC, const unsigned *FP); /// getTargetTriple - Return the target triple string. - StringRef getTargetTriple() const { - return TargetTriple; - } + const Triple &getTargetTriple() const { return TargetTriple; } /// getCPU - Return the CPU string. StringRef getCPU() const { diff --git a/llvm/include/llvm/Support/TargetRegistry.h b/llvm/include/llvm/Support/TargetRegistry.h index 5b3e7a74735..47b9b379c92 100644 --- a/llvm/include/llvm/Support/TargetRegistry.h +++ b/llvm/include/llvm/Support/TargetRegistry.h @@ -98,7 +98,7 @@ public: typedef MCInstrInfo *(*MCInstrInfoCtorFnTy)(void); typedef MCInstrAnalysis *(*MCInstrAnalysisCtorFnTy)(const MCInstrInfo *Info); typedef MCRegisterInfo *(*MCRegInfoCtorFnTy)(StringRef TT); - typedef MCSubtargetInfo *(*MCSubtargetInfoCtorFnTy)(StringRef TT, + typedef MCSubtargetInfo *(*MCSubtargetInfoCtorFnTy)(const Triple &TT, StringRef CPU, StringRef Features); typedef TargetMachine *(*TargetMachineCtorTy)( @@ -334,18 +334,18 @@ public: /// createMCSubtargetInfo - Create a MCSubtargetInfo implementation. /// - /// \param Triple This argument is used to determine the target machine + /// \param TheTriple This argument is used to determine the target machine /// feature set; it should always be provided. Generally this should be /// either the target triple from the module, or the target triple of the /// host if that does not exist. /// \param CPU This specifies the name of the target CPU. /// \param Features This specifies the string representation of the /// additional target features. - MCSubtargetInfo *createMCSubtargetInfo(StringRef Triple, StringRef CPU, + MCSubtargetInfo *createMCSubtargetInfo(StringRef TheTriple, StringRef CPU, StringRef Features) const { if (!MCSubtargetInfoCtorFn) return nullptr; - return MCSubtargetInfoCtorFn(Triple, CPU, Features); + return MCSubtargetInfoCtorFn(Triple(TheTriple), CPU, Features); } /// createTargetMachine - Create a target specific machine implementation @@ -1056,7 +1056,7 @@ template <class MCSubtargetInfoImpl> struct RegisterMCSubtargetInfo { } private: - static MCSubtargetInfo *Allocator(StringRef /*TT*/, StringRef /*CPU*/, + static MCSubtargetInfo *Allocator(const Triple & /*TT*/, StringRef /*CPU*/, StringRef /*FS*/) { return new MCSubtargetInfoImpl(); } |

