Remove TargetInfo::getTargetPrefix().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79907 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index 8f5da42..9ba5f71 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -557,8 +557,10 @@
// See if we have a target specific intrinsic.
const char *Name = getContext().BuiltinInfo.GetName(BuiltinID);
- Intrinsic::ID IntrinsicID =
- Intrinsic::getIntrinsicForGCCBuiltin(Target.getTargetPrefix(), Name);
+ Intrinsic::ID IntrinsicID = Intrinsic::not_intrinsic;
+ if (const char *Prefix =
+ llvm::Triple::getArchTypePrefix(Target.getTriple().getArch()))
+ IntrinsicID = Intrinsic::getIntrinsicForGCCBuiltin(Prefix, Name);
if (IntrinsicID != Intrinsic::not_intrinsic) {
SmallVector<Value*, 16> Args;
@@ -610,12 +612,16 @@
Value *CodeGenFunction::EmitTargetBuiltinExpr(unsigned BuiltinID,
const CallExpr *E) {
- const char *TargetPrefix = Target.getTargetPrefix();
- if (strcmp(TargetPrefix, "x86") == 0)
+ switch (Target.getTriple().getArch()) {
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
return EmitX86BuiltinExpr(BuiltinID, E);
- else if (strcmp(TargetPrefix, "ppc") == 0)
+ case llvm::Triple::ppc:
+ case llvm::Triple::ppc64:
return EmitPPCBuiltinExpr(BuiltinID, E);
- return 0;
+ default:
+ return 0;
+ }
}
Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,