blob: f21ec9e46e9fb14e1daf971d63be835c7f9ae8c4 [file] [log] [blame]
//===--- PrimarySpecificPaths.h ---------------------------------*- C++ -*-===//
// This source file is part of the open source project
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
// See for license information
// See for the list of Swift project authors
#include "swift/Basic/LLVM.h"
#include "swift/Basic/SupplementaryOutputPaths.h"
#include "llvm/ADT/StringRef.h"
#include <string>
namespace swift {
/// Holds all of the output paths, and debugging-info path that are
/// specific to which primary file is being compiled at the moment.
class PrimarySpecificPaths {
/// The name of the main output file,
/// that is, the .o file for this input (or a file specified by -o).
/// If there is no such file, contains an empty string. If the output
/// is to be written to stdout, contains "-".
std::string OutputFilename;
SupplementaryOutputPaths SupplementaryOutputs;
/// The name of the "main" input file, used by the debug info.
std::string MainInputFilenameForDebugInfo;
PrimarySpecificPaths(StringRef OutputFilename = StringRef(),
StringRef MainInputFilenameForDebugInfo = StringRef(),
SupplementaryOutputPaths SupplementaryOutputs =
: OutputFilename(OutputFilename),
MainInputFilenameForDebugInfo(MainInputFilenameForDebugInfo) {}
bool haveModuleOrModuleDocOutputPaths() const {
return !SupplementaryOutputs.ModuleOutputPath.empty() ||
bool haveModuleSummaryOutputPath() const {
return !SupplementaryOutputs.ModuleSummaryOutputPath.empty();
} // namespace swift