aboutsummaryrefslogtreecommitdiff
path: root/Basic
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-12-03 22:06:55 +0000
committerTed Kremenek <kremenek@apple.com>2007-12-03 22:06:55 +0000
commitae3607684c5978dc2d877141015056c9d24f17ea (patch)
treee37d4bfd2ad9f7ea6c06c2d52afd60b4d234d258 /Basic
parent0d6ca11db071e4d4e1cd8fe89c3d6d6b4988d8d5 (diff)
Implemented initial support for "-triple" option to the clang driver. This
replaces the functionality previously provided by just "-arch" (which is still supported but has different semantics). The new behavior is as follows: (1) If the user does not specify -triple: (a) If no -arch options are specified, the target triple used is the host triple (in llvm/Config/config.h). (b) If one or more -arch's are specified (and no -triple), then there is one triple for each -arch, where the specified arch is substituted for the arch in the host triple. Example: host triple = i686-apple-darwin9 command: clang -arch ppc -arch ppc64 ... triples used: ppc-apple-darwin9 ppc64-apple-darwin9 (2) The user does specify a -triple (only one allowed): (a) If no -arch options are specified, the triple specified by -triple is used. E.g clang -triple i686-apple-darwin9 (b) If one or more -arch options are specified, then the triple specified by -triple is used as the primary target, and the arch's specified by -arch are used to create secondary targets. For example: clang -triple i686-apple-darwin9 -arch ppc -arch ppc64 has the following targets: i686-apple-darwin9 (primary target) ppc-apple-darwin9 ppc64-apple-darwin9 Other changes related to the changes to the driver: - TargetInfoImpl now includes the triple string. - TargetInfo::getTargetTriple returns the triple for its primary target. - test case test/Parser/portability.c has been updated because "-arch linux" is no longer valid ("linux" is an OS, not an arch); instead we use a bogus architecture "bogusW16W16" where WCharWidth=16 and WCharAlign=16. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Basic')
-rw-r--r--Basic/TargetInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Basic/TargetInfo.cpp b/Basic/TargetInfo.cpp
index ec91bdd1a2..6038e614a5 100644
--- a/Basic/TargetInfo.cpp
+++ b/Basic/TargetInfo.cpp
@@ -52,6 +52,10 @@ void TargetInfo::getLongDoubleInfo(uint64_t &Size, unsigned &Align,
//===----------------------------------------------------------------------===//
+const char* TargetInfo::getTargetTriple() const {
+ return PrimaryTarget->getTargetTriple();
+}
+
/// DiagnoseNonPortability - When a use of a non-portable target feature is
/// used, this method emits the diagnostic and marks the translation unit as
/// non-portable.