summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver/ToolChains.h')
-rw-r--r--clang/lib/Driver/ToolChains.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains.h b/clang/lib/Driver/ToolChains.h
index 5da1bc4eb3c..60453ebca4d 100644
--- a/clang/lib/Driver/ToolChains.h
+++ b/clang/lib/Driver/ToolChains.h
@@ -118,6 +118,21 @@ public:
virtual bool IsUnwindTablesDefault() const;
virtual const char *GetDefaultRelocationModel() const;
virtual const char *GetForcedPicModel() const;
+
+protected:
+ /// \name ToolChain Implementation Helper Functions
+ /// @{
+
+ /// \brief Check whether the target triple's architecture is 64-bits.
+ bool isTarget64Bit() const {
+ return (getTriple().getArch() == llvm::Triple::x86_64 ||
+ getTriple().getArch() == llvm::Triple::ppc64);
+ }
+ /// \brief Check whether the target triple's architecture is 32-bits.
+ /// FIXME: This should likely do more than just negate the 64-bit query.
+ bool isTarget32Bit() const { return !isTarget64Bit(); }
+
+ /// @}
};
/// Darwin - The base Darwin tool chain.
OpenPOWER on IntegriCloud