mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Target triple OS detection tidyup. NFC
Use Triple::isOS*() helpers where possible. llvm-svn: 222960
This commit is contained in:
parent
120c878c24
commit
3d5273ea80
@ -346,7 +346,7 @@ static bool CreatePrologue(Function *F, Module *M, ReturnInst *RI,
|
||||
|
||||
StackGuardVar = ConstantExpr::getIntToPtr(
|
||||
OffsetVal, PointerType::get(PtrTy, AddressSpace));
|
||||
} else if (Trip.getOS() == llvm::Triple::OpenBSD) {
|
||||
} else if (Trip.isOSOpenBSD()) {
|
||||
StackGuardVar = M->getOrInsertGlobal("__guard_local", PtrTy);
|
||||
cast<GlobalValue>(StackGuardVar)
|
||||
->setVisibility(GlobalValue::HiddenVisibility);
|
||||
@ -477,7 +477,7 @@ BasicBlock *StackProtector::CreateFailBB() {
|
||||
LLVMContext &Context = F->getContext();
|
||||
BasicBlock *FailBB = BasicBlock::Create(Context, "CallStackCheckFailBlk", F);
|
||||
IRBuilder<> B(FailBB);
|
||||
if (Trip.getOS() == llvm::Triple::OpenBSD) {
|
||||
if (Trip.isOSOpenBSD()) {
|
||||
Constant *StackChkFail = M->getOrInsertFunction(
|
||||
"__stack_smash_handler", Type::getVoidTy(Context),
|
||||
Type::getInt8PtrTy(Context), nullptr);
|
||||
|
@ -414,7 +414,7 @@ static void InitLibcallNames(const char **Names, const Triple &TT) {
|
||||
Names[RTLIB::SINCOS_PPCF128] = nullptr;
|
||||
}
|
||||
|
||||
if (TT.getOS() != Triple::OpenBSD) {
|
||||
if (!TT.isOSOpenBSD()) {
|
||||
Names[RTLIB::STACKPROTECTOR_CHECK_FAIL] = "__stack_chk_fail";
|
||||
} else {
|
||||
// These are generally not available.
|
||||
|
@ -74,9 +74,7 @@ PPCELFMCAsmInfo::PPCELFMCAsmInfo(bool is64Bit, const Triple& T) {
|
||||
AssemblerDialect = 1; // New-Style mnemonics.
|
||||
LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
|
||||
|
||||
if (T.getOS() == llvm::Triple::FreeBSD ||
|
||||
(T.getOS() == llvm::Triple::NetBSD && !is64Bit) ||
|
||||
(T.getOS() == llvm::Triple::OpenBSD && !is64Bit))
|
||||
if (T.isOSFreeBSD() || ((T.isOSNetBSD() || T.isOSOpenBSD()) && !is64Bit))
|
||||
UseIntegratedAssembler = true;
|
||||
}
|
||||
|
||||
|
@ -42,8 +42,7 @@ SparcELFMCAsmInfo::SparcELFMCAsmInfo(StringRef TT) {
|
||||
SunStyleELFSectionSwitchSyntax = true;
|
||||
UsesELFSectionDirectiveForBSS = true;
|
||||
|
||||
if (TheTriple.getOS() == llvm::Triple::Solaris ||
|
||||
TheTriple.getOS() == llvm::Triple::OpenBSD)
|
||||
if (TheTriple.isOSSolaris() || TheTriple.isOSOpenBSD())
|
||||
UseIntegratedAssembler = true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user