//===-- 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()); }