Changeset View
Changeset View
Standalone View
Standalone View
contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 9,890 Lines • ▼ Show 20 Lines | if (Size.isPowerOfTwo()) { | ||||
if (!PointeeType->isIncompleteType() && | if (!PointeeType->isIncompleteType() && | ||||
Info.Ctx.getTypeAlignInChars(PointeeType) >= Size) { | Info.Ctx.getTypeAlignInChars(PointeeType) >= Size) { | ||||
// OK, we will inline operations on this object. | // OK, we will inline operations on this object. | ||||
return Success(1, E); | return Success(1, E); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
// Don't emit call to external __atomic_always_lock_free for | |||||
jhibbits: This looks redundant. Right below it returns Success(0, E) if the BuiltinOp is… | |||||
Done Inline ActionsI fact I would to make it avoid emitting external call for "__ atomic_is_lock_free" and "__ c11_atomic_is_lock_free" as well, if ppc32 bit. alfredo: I fact I would to make it avoid emitting external call for "__ atomic_is_lock_free" and "__… | |||||
Done Inline ActionsThe comment should reflect that, then. The comment states you just want to avoid __atomic_always_lock_free(), but you want to avoid all 3 on powerpc. jhibbits: The comment should reflect that, then. The comment states you just want to avoid… | |||||
// target FreeBSD on PowerPC 32-bit | |||||
// TODO: add llvm::Triple::ppcspe when available | |||||
jhibbitsUnsubmitted Done Inline ActionsWe'll be using the ppc triple Arch for powerpcspe. jhibbits: We'll be using the ppc triple Arch for powerpcspe. | |||||
if (Info.Ctx.getTargetInfo().getTriple().isOSFreeBSD() && | |||||
Info.Ctx.getTargetInfo().getTriple().getArch() == llvm::Triple::ppc) { | |||||
return Success(0, E); | |||||
} | |||||
return BuiltinOp == Builtin::BI__atomic_always_lock_free ? | return BuiltinOp == Builtin::BI__atomic_always_lock_free ? | ||||
Success(0, E) : Error(E); | Success(0, E) : Error(E); | ||||
Done Inline ActionsIt is better to avoid introducing a new line here. luporl: It is better to avoid introducing a new line here. | |||||
} | } | ||||
case Builtin::BIomp_is_initial_device: | case Builtin::BIomp_is_initial_device: | ||||
// We can decide statically which value the runtime would return if called. | // We can decide statically which value the runtime would return if called. | ||||
return Success(Info.getLangOpts().OpenMPIsDevice ? 0 : 1, E); | return Success(Info.getLangOpts().OpenMPIsDevice ? 0 : 1, E); | ||||
case Builtin::BI__builtin_add_overflow: | case Builtin::BI__builtin_add_overflow: | ||||
case Builtin::BI__builtin_sub_overflow: | case Builtin::BI__builtin_sub_overflow: | ||||
case Builtin::BI__builtin_mul_overflow: | case Builtin::BI__builtin_mul_overflow: | ||||
case Builtin::BI__builtin_sadd_overflow: | case Builtin::BI__builtin_sadd_overflow: | ||||
▲ Show 20 Lines • Show All 3,317 Lines • Show Last 20 Lines |
This looks redundant. Right below it returns Success(0, E) if the BuiltinOp is __atomic_always_lock_free().