[cfe-commits] r79907 - in /cfe/trunk: include/clang/Basic/TargetInfo.h lib/Basic/Targets.cpp lib/CodeGen/CGBuiltin.cpp
Daniel Dunbar
daniel at zuster.org
Mon Aug 24 02:54:37 PDT 2009
Author: ddunbar
Date: Mon Aug 24 04:54:37 2009
New Revision: 79907
URL: http://llvm.org/viewvc/llvm-project?rev=79907&view=rev
Log:
Remove TargetInfo::getTargetPrefix().
Modified:
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=79907&r1=79906&r2=79907&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Mon Aug 24 04:54:37 2009
@@ -284,10 +284,6 @@
virtual const char *getClobbers() const = 0;
- /// getTargetPrefix - Return the target prefix used for identifying
- /// llvm intrinsics.
- virtual const char *getTargetPrefix() const = 0;
-
/// getTriple - Return the target triple of the primary target.
const llvm::Triple &getTriple() const {
return Triple;
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=79907&r1=79906&r2=79907&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Mon Aug 24 04:54:37 2009
@@ -377,9 +377,6 @@
" 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,
@@ -582,9 +579,6 @@
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;
@@ -1051,9 +1045,6 @@
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.
@@ -1127,9 +1118,6 @@
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,
@@ -1258,9 +1246,12 @@
}
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,
@@ -1305,9 +1296,6 @@
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,
@@ -1366,9 +1354,6 @@
Records = 0;
NumRecords = 0;
}
- virtual const char *getTargetPrefix() const {
- return "s390x";
- }
virtual void getDefaultLangOptions(LangOptions &Opts) {
TargetInfo::getDefaultLangOptions(Opts);
@@ -1439,10 +1424,6 @@
NumRecords = 0;
}
- virtual const char *getTargetPrefix() const {
- return "bfin";
- }
-
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const;
@@ -1536,11 +1517,12 @@
}
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,
Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=79907&r1=79906&r2=79907&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Mon Aug 24 04:54:37 2009
@@ -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,
More information about the cfe-commits
mailing list