" void* reg_save_area;"
"} __builtin_va_list[1];";*/
}
- virtual const char *getTargetPrefix() const {
- return "ppc";
- }
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const;
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
Records = BuiltinInfo;
NumRecords = clang::X86::LastTSBuiltin-Builtin::FirstTSBuiltin;
}
- virtual const char *getTargetPrefix() const {
- return "x86";
- }
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const {
Names = GCCRegNames;
virtual const char *getVAListDeclaration() const {
return "typedef char* __builtin_va_list;";
}
- virtual const char *getTargetPrefix() const {
- return "arm";
- }
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const {
// FIXME: Implement.
virtual const char *getVAListDeclaration() const {
return "typedef void* __builtin_va_list;";
}
- virtual const char *getTargetPrefix() const {
- return "sparc";
- }
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const;
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
}
virtual void getTargetBuiltins(const Builtin::Info *&Records,
unsigned &NumRecords) const {}
- virtual const char *getVAListDeclaration() const { return "";}
- virtual const char *getClobbers() const {return "";}
- virtual const char *getTargetPrefix() const {return "pic16";}
+ virtual const char *getVAListDeclaration() const {
+ return "";
+ }
+ virtual const char *getClobbers() const {
+ return "";
+ }
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const {}
virtual bool validateAsmConstraint(const char *&Name,
Records = 0;
NumRecords = 0;
}
- virtual const char *getTargetPrefix() const {
- return "msp430";
- }
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const;
virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
Records = 0;
NumRecords = 0;
}
- virtual const char *getTargetPrefix() const {
- return "s390x";
- }
virtual void getDefaultLangOptions(LangOptions &Opts) {
TargetInfo::getDefaultLangOptions(Opts);
NumRecords = 0;
}
- virtual const char *getTargetPrefix() const {
- return "bfin";
- }
-
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const;
}
virtual void getTargetBuiltins(const Builtin::Info *&Records,
unsigned &NumRecords) const {}
- virtual const char *getClobbers() const {return "";}
+ virtual const char *getClobbers() const {
+ return "";
+ }
virtual const char *getVAListDeclaration() const {
return "typedef void* __builtin_va_list;";
}
- virtual const char *getTargetPrefix() const {return "tce";}
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const {}
virtual bool validateAsmConstraint(const char *&Name,
// 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;
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,