[frontend] Put CompilerInvocation implementation into its own file.

Swift SVN r7464
This commit is contained in:
Argyrios Kyrtzidis
2013-08-22 18:29:54 +00:00
parent 4536a90421
commit 7b3988f74b
3 changed files with 29 additions and 13 deletions

View File

@@ -0,0 +1,28 @@
//===-- CompilerInvocation.cpp - CompilerInvocation methods ---------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#include "swift/Frontend/Frontend.h"
#include "llvm/Support/Path.h"
using namespace swift;
swift::CompilerInvocation::CompilerInvocation() {
TargetTriple = llvm::sys::getDefaultTargetTriple();
}
void CompilerInvocation::setMainExecutablePath(StringRef Path) {
llvm::SmallString<128> LibPath(Path);
llvm::sys::path::remove_filename(LibPath); // Remove /swift
llvm::sys::path::remove_filename(LibPath); // Remove /bin
llvm::sys::path::append(LibPath, "lib", "swift");
setRuntimeIncludePath(LibPath.str());
}