summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.h
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-06 23:39:37 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-06 23:39:37 +0000
commitefad16ad6bfa6450c3b5873f900f64d17d7f675b (patch)
tree64f2d3a20c53b7302b254612881c518ba3b89204 /clang/lib/Driver/ToolChains.h
parent4c90fba23e213d9260ae1dfdef621596a9142706 (diff)
downloadbcm5719-llvm-efad16ad6bfa6450c3b5873f900f64d17d7f675b.tar.gz
bcm5719-llvm-efad16ad6bfa6450c3b5873f900f64d17d7f675b.zip
Begin lifting some of the one-off checking logic into generic helper
routines on the base toolchain class. llvm-svn: 143900
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