blob: ab907c1aeff67c35fdfa80496fd448cdb2e8a2e9 [file] [log] [blame]
Daniel Dunbar9e2136d2009-03-16 05:25:36 +00001//===--- ToolChain.cpp - Collections of tools for one platform ----------*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "clang/Driver/ToolChain.h"
11
12#include "clang/Driver/Action.h"
13#include "clang/Driver/Driver.h"
Daniel Dunbar7a70c5d2009-03-17 21:21:26 +000014#include "clang/Driver/HostInfo.h"
Daniel Dunbar9e2136d2009-03-16 05:25:36 +000015
16using namespace clang::driver;
17
Daniel Dunbar51c7f972009-05-22 02:53:45 +000018ToolChain::ToolChain(const HostInfo &_Host, const llvm::Triple &_Triple)
19 : Host(_Host), Triple(_Triple) {
Daniel Dunbar9e2136d2009-03-16 05:25:36 +000020}
21
22ToolChain::~ToolChain() {
23}
24
Daniel Dunbar083edf72009-12-21 18:54:17 +000025const Driver &ToolChain::getDriver() const {
26 return Host.getDriver();
27}
28
Daniel Dunbar9c3ed5f2010-07-14 18:46:23 +000029std::string ToolChain::GetFilePath(const char *Name) const {
Daniel Dunbarf0eddb82009-03-18 02:55:38 +000030 return Host.getDriver().GetFilePath(Name, *this);
Mike Stump11289f42009-09-09 15:08:12 +000031
Daniel Dunbar9e2136d2009-03-16 05:25:36 +000032}
33
Daniel Dunbar9c3ed5f2010-07-14 18:46:23 +000034std::string ToolChain::GetProgramPath(const char *Name, bool WantFile) const {
Mike Stumpdb657372009-03-27 00:40:20 +000035 return Host.getDriver().GetProgramPath(Name, *this, WantFile);
Daniel Dunbar9e2136d2009-03-16 05:25:36 +000036}
Daniel Dunbarcc7df6c2010-08-02 05:43:56 +000037
38types::ID ToolChain::LookupTypeForExtension(const char *Ext) const {
39 return types::lookupTypeForExtension(Ext);
40}