mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[frontend] Put CompilerInvocation implementation into its own file.
Swift SVN r7464
This commit is contained in:
28
lib/Frontend/CompilerInvocation.cpp
Normal file
28
lib/Frontend/CompilerInvocation.cpp
Normal 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());
|
||||
}
|
||||
Reference in New Issue
Block a user