Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Basic/Targets/RISCV.h
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | RISCV32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) | ||||
: RISCVTargetInfo(Triple, Opts) { | : RISCVTargetInfo(Triple, Opts) { | ||||
IntPtrType = SignedInt; | IntPtrType = SignedInt; | ||||
PtrDiffType = SignedInt; | PtrDiffType = SignedInt; | ||||
SizeType = UnsignedInt; | SizeType = UnsignedInt; | ||||
resetDataLayout("e-m:e-p:32:32-i64:64-n32-S128"); | resetDataLayout("e-m:e-p:32:32-i64:64-n32-S128"); | ||||
} | } | ||||
bool setABI(const std::string &Name) override { | bool setABI(const std::string &Name) override { | ||||
// TODO: support ilp32f and ilp32d ABIs. | if (Name == "ilp32" || Name == "ilp32f" || Name == "ilp32d") { | ||||
if (Name == "ilp32") { | |||||
ABI = Name; | ABI = Name; | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
}; | }; | ||||
class LLVM_LIBRARY_VISIBILITY RISCV64TargetInfo : public RISCVTargetInfo { | class LLVM_LIBRARY_VISIBILITY RISCV64TargetInfo : public RISCVTargetInfo { | ||||
public: | public: | ||||
RISCV64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) | RISCV64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts) | ||||
: RISCVTargetInfo(Triple, Opts) { | : RISCVTargetInfo(Triple, Opts) { | ||||
LongWidth = LongAlign = PointerWidth = PointerAlign = 64; | LongWidth = LongAlign = PointerWidth = PointerAlign = 64; | ||||
IntMaxType = Int64Type = SignedLong; | IntMaxType = Int64Type = SignedLong; | ||||
resetDataLayout("e-m:e-p:64:64-i64:64-i128:128-n64-S128"); | resetDataLayout("e-m:e-p:64:64-i64:64-i128:128-n64-S128"); | ||||
} | } | ||||
bool setABI(const std::string &Name) override { | bool setABI(const std::string &Name) override { | ||||
// TODO: support lp64f and lp64d ABIs. | if (Name == "lp64" || Name == "lp64f" || Name == "lp64d") { | ||||
if (Name == "lp64") { | |||||
ABI = Name; | ABI = Name; | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
}; | }; | ||||
} // namespace targets | } // namespace targets | ||||
} // namespace clang | } // namespace clang | ||||
#endif // LLVM_CLANG_LIB_BASIC_TARGETS_RISCV_H | #endif // LLVM_CLANG_LIB_BASIC_TARGETS_RISCV_H |