summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-26 16:09:13 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-26 16:09:13 +0000
commitb1024880f118fb426d1bffeb92aa9645454f30a3 (patch)
tree5d16f0903edf25379d5b716c14f0a7b894b9f275
parent389925dc87b6d96ccd6787f1dca67ac8c26caae2 (diff)
downloadbcm5719-llvm-b1024880f118fb426d1bffeb92aa9645454f30a3.tar.gz
bcm5719-llvm-b1024880f118fb426d1bffeb92aa9645454f30a3.zip
Driver: Print the correct target when printing the version.
llvm-svn: 67756
-rw-r--r--clang/include/clang/Driver/Driver.h2
-rw-r--r--clang/lib/Driver/Driver.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h
index cdcb97691f1..cb7f3b035ad 100644
--- a/clang/include/clang/Driver/Driver.h
+++ b/clang/include/clang/Driver/Driver.h
@@ -161,7 +161,7 @@ public:
void PrintOptions(const ArgList &Args) const;
/// PrintVersion - Print the driver version.
- void PrintVersion() const;
+ void PrintVersion(const Compilation &C) const;
/// PrintActions - Print the list of actions.
void PrintActions(const Compilation &C) const;
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 1562fde14ca..94b33ff61fd 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -225,7 +225,7 @@ void Driver::PrintOptions(const ArgList &Args) const {
}
}
-void Driver::PrintVersion() const {
+void Driver::PrintVersion(const Compilation &C) const {
static char buf[] = "$URL$";
char *zap = strstr(buf, "/lib/Driver");
if (zap)
@@ -243,10 +243,10 @@ void Driver::PrintVersion() const {
// FIXME: The following handlers should use a callback mechanism, we
// don't know what the client would like to do.
llvm::errs() << "clang version 1.0 (" << vers << " " << revision << ")" << "\n";
- // FIXME: Add cmake support and remove #ifdef
-#ifdef TARGET_TRIPLE
- llvm::errs() << "Target: " << TARGET_TRIPLE << "\n";
-#endif
+
+ const ToolChain &TC = C.getDefaultToolChain();
+ llvm::errs() << "Target: " << TC.getArchName() << '-'
+ << TC.getPlatform() << '-' << TC.getOS() << '\n';
}
bool Driver::HandleImmediateArgs(const Compilation &C) {
@@ -255,7 +255,7 @@ bool Driver::HandleImmediateArgs(const Compilation &C) {
// in practice.
if (C.getArgs().hasArg(options::OPT_v) ||
C.getArgs().hasArg(options::OPT__HASH_HASH_HASH)) {
- PrintVersion();
+ PrintVersion(C);
SuppressMissingInputWarning = true;
}
OpenPOWER on IntegriCloud