From ed64d62c70414db501f7bdda8dcf0b4fa0dd8bcc Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Thu, 11 Jun 2015 15:34:59 +0000 Subject: Replace string GNU Triples with llvm::Triple in computeDataLayout(). NFC. Summary: This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, jfb, rengolin Differential Revision: http://reviews.llvm.org/D10361 llvm-svn: 239538 --- llvm/lib/Target/R600/AMDGPUTargetMachine.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Target/R600/AMDGPUTargetMachine.cpp') diff --git a/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp b/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp index 0e37127725c..bb5d9e99ff4 100644 --- a/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp +++ b/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp @@ -51,11 +51,10 @@ static MachineSchedRegistry SchedCustomRegistry("r600", "Run R600's custom scheduler", createR600MachineScheduler); -static std::string computeDataLayout(StringRef TT) { - Triple Triple(TT); +static std::string computeDataLayout(const Triple &TT) { std::string Ret = "e-p:32:32"; - if (Triple.getArch() == Triple::amdgcn) { + if (TT.getArch() == Triple::amdgcn) { // 32-bit private, local, and region pointers. 64-bit global and constant. Ret += "-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-p24:64:64"; } @@ -71,8 +70,8 @@ AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, StringRef TT, TargetOptions Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OptLevel) - : LLVMTargetMachine(T, computeDataLayout(TT), TT, CPU, FS, Options, RM, CM, - OptLevel), + : LLVMTargetMachine(T, computeDataLayout(Triple(TT)), TT, CPU, FS, Options, + RM, CM, OptLevel), TLOF(new TargetLoweringObjectFileELF()), Subtarget(Triple(TT), CPU, FS, *this), IntrinsicInfo() { setRequiresStructuredCFG(true); -- cgit v1.2.3