From a37aab2515a174ae203659ff24f6274b3a823105 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 19 Apr 2011 20:54:28 +0000 Subject: [PATCH] Target/PPC: Add a TargetTriple field. llvm-svn: 129809 --- llvm/lib/Target/PowerPC/PPCSubtarget.cpp | 3 ++- llvm/lib/Target/PowerPC/PPCSubtarget.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp index 72a1deeced44..2fd62a6b9c84 100644 --- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp +++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp @@ -70,7 +70,8 @@ PPCSubtarget::PPCSubtarget(const std::string &TT, const std::string &FS, , HasSTFIWX(false) , HasLazyResolverStubs(false) , IsJITCodeModel(false) - , DarwinVers(0) { + , DarwinVers(0) + , TargetTriple(TT) { // Determine default and user specified characteristics std::string CPU = "generic"; diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.h b/llvm/lib/Target/PowerPC/PPCSubtarget.h index 00ec7474c9e3..8502bf4d6565 100644 --- a/llvm/lib/Target/PowerPC/PPCSubtarget.h +++ b/llvm/lib/Target/PowerPC/PPCSubtarget.h @@ -14,6 +14,7 @@ #ifndef POWERPCSUBTARGET_H #define POWERPCSUBTARGET_H +#include "llvm/ADT/Triple.h" #include "llvm/Target/TargetInstrItineraries.h" #include "llvm/Target/TargetSubtarget.h" @@ -68,6 +69,10 @@ protected: /// DarwinVers - Nonzero if this is a darwin platform. Otherwise, the numeric /// version of the platform, e.g. 8 = 10.4 (Tiger), 9 = 10.5 (Leopard), etc. unsigned char DarwinVers; // Is any darwin-ppc platform. + + /// TargetTriple - What processor and OS we're targeting. + Triple TargetTriple; + public: /// This constructor initializes the data members to match that /// of the specified triple. @@ -134,6 +139,8 @@ public: bool hasAltivec() const { return HasAltivec; } bool isGigaProcessor() const { return IsGigaProcessor; } + const Triple &getTargetTriple() const { return TargetTriple; } + /// isDarwin - True if this is any darwin platform. bool isDarwin() const { return DarwinVers != 0; } /// isDarwin - True if this is darwin9 (leopard, 10.5) or above.