Refactor NVPTX's computeDataLayout.

No functionality change.

llvm-svn: 197312
This commit is contained in:
Rafael Espindola 2013-12-14 06:42:48 +00:00
parent e8b32c0d4d
commit d0ba591b49

View File

@ -64,13 +64,18 @@ extern "C" void LLVMInitializeNVPTXTarget() {
}
static std::string computeDataLayout(const NVPTXSubtarget &ST) {
std::string Ret = "e";
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-"
Ret += "-p:64:64:64";
else
Ret += "-p:32:32:32";
Ret += "-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 Ret;
}
NVPTXTargetMachine::NVPTXTargetMachine(