[llvm] r197311 - Turn NVPTXSubtarget::getDataLayout into a static function.
Rafael Espindola
rafael.espindola at gmail.com
Fri Dec 13 22:36:31 PST 2013
Author: rafael
Date: Sat Dec 14 00:36:30 2013
New Revision: 197311
URL: http://llvm.org/viewvc/llvm-project?rev=197311&view=rev
Log:
Turn NVPTXSubtarget::getDataLayout into a static function.
No functionality change.
Modified:
llvm/trunk/lib/Target/NVPTX/NVPTXSubtarget.h
llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXSubtarget.h?rev=197311&r1=197310&r2=197311&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXSubtarget.h (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXSubtarget.h Sat Dec 14 00:36:30 2013
@@ -74,21 +74,6 @@ public:
unsigned getPTXVersion() const { return PTXVersion; }
void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
-
- std::string getDataLayout() const {
- const char *p;
- if (is64Bit())
- p = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"
- "f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-"
- "n16:32:64";
- else
- p = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"
- "f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-"
- "n16:32:64";
-
- return std::string(p);
- }
-
};
} // End llvm namespace
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp?rev=197311&r1=197310&r2=197311&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp Sat Dec 14 00:36:30 2013
@@ -63,12 +63,22 @@ extern "C" void LLVMInitializeNVPTXTarge
initializeGenericToNVVMPass(*PassRegistry::getPassRegistry());
}
+static std::string computeDataLayout(const NVPTXSubtarget &ST) {
+ if (ST.is64Bit())
+ return "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"
+ "f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-"
+ "n16:32:64";
+ return "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-"
+ "f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-"
+ "n16:32:64";
+}
+
NVPTXTargetMachine::NVPTXTargetMachine(
const Target &T, StringRef TT, StringRef CPU, StringRef FS,
const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM,
CodeGenOpt::Level OL, bool is64bit)
: LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
- Subtarget(TT, CPU, FS, is64bit), DL(Subtarget.getDataLayout()),
+ Subtarget(TT, CPU, FS, is64bit), DL(computeDataLayout(Subtarget)),
InstrInfo(*this), TLInfo(*this), TSInfo(*this),
FrameLowering(
*this, is64bit) /*FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0)*/ {
More information about the llvm-commits
mailing list