Review fixes:

Rename isThereAPrimaryInputWithAFilenameAt to isInputPrimary.
Remove spurious delayed_function_body_parsing.
Simply return type of getOutputFilenamesFromCommandLineOrFilelist.
This commit is contained in:
David Ungar
2017-11-28 13:28:10 -08:00
parent b4681b154d
commit d16ae98e2a
4 changed files with 7 additions and 13 deletions

View File

@@ -158,7 +158,7 @@ public:
: Optional<StringRef>();
}
bool isThereAPrimaryInputWithAFilenameAt(unsigned i) const {
bool isInputPrimary(unsigned i) const {
assertMustNotBeMoreThanOnePrimaryInput();
if (Optional<SelectedInput> primaryInput = getOptionalPrimaryInput())
return primaryInput->isFilename() && primaryInput->Index == i;

View File

@@ -21,10 +21,6 @@ def triple : Separate<["-"], "triple">, Alias<target>;
def color_diagnostics : Flag<["-"], "color-diagnostics">,
HelpText<"Print diagnostics in color">;
def delayed_function_body_parsing :
Flag<["-"], "delayed-function-body-parsing">,
HelpText<"Delay function body parsing until the end of all files">;
def primary_file : Separate<["-"], "primary-file">,
HelpText<"Produce output for this file, not the whole module">;

View File

@@ -288,7 +288,7 @@ private:
/// Returns the output filenames on the command line or in the output
/// filelist. If there
/// were neither -o's nor an output filelist, returns an empty vector.
const std::vector<std::string> &getOutputFilenamesFromCommandLineOrFilelist();
ArrayRef<std::string> getOutputFilenamesFromCommandLineOrFilelist();
bool checkForUnusedOutputPaths() const;
@@ -671,7 +671,7 @@ bool FrontendArgsToOptionsConverter::computeFallbackModuleName() {
// selected".
return false;
}
const std::vector<std::string> &outputFilenames =
ArrayRef<std::string> outputFilenames =
getOutputFilenamesFromCommandLineOrFilelist();
bool isOutputAUniqueOrdinaryFile =
@@ -689,7 +689,7 @@ bool FrontendArgsToOptionsConverter::computeOutputFilenames() {
FrontendOptions::doesActionProduceOutput(Opts.RequestedAction) ||
!FrontendOptions::doesActionProduceTextualOutput(Opts.RequestedAction));
const std::vector<std::string> &outputFilenamesFromCommandLineOrFilelist =
ArrayRef<std::string> outputFilenamesFromCommandLineOrFilelist =
getOutputFilenamesFromCommandLineOrFilelist();
if (outputFilenamesFromCommandLineOrFilelist.size() > 1) {
@@ -887,7 +887,7 @@ void FrontendArgsToOptionsConverter::computeLLVMArgs() {
}
}
const std::vector<std::string> &
ArrayRef<std::string>
FrontendArgsToOptionsConverter::getOutputFilenamesFromCommandLineOrFilelist() {
if (cachedOutputFilenamesFromCommandLineOrFilelist) {
return *cachedOutputFilenamesFromCommandLineOrFilelist;

View File

@@ -741,8 +741,7 @@ bool CompilerInstance::setUpForFileAt(unsigned i) {
if (SILMode || (MainMode && filename(File) == "main.swift"))
MainBufferID = ExistingBufferID.getValue();
if (Invocation.getFrontendOptions()
.Inputs.isThereAPrimaryInputWithAFilenameAt(i))
if (Invocation.getFrontendOptions().Inputs.isInputPrimary(i))
PrimaryBufferID = ExistingBufferID.getValue();
return false; // replaced by a memory buffer.
@@ -784,8 +783,7 @@ bool CompilerInstance::setUpForFileAt(unsigned i) {
if (SILMode || (MainMode && filename(File) == "main.swift"))
MainBufferID = BufferID;
if (Invocation.getFrontendOptions()
.Inputs.isThereAPrimaryInputWithAFilenameAt(i))
if (Invocation.getFrontendOptions().Inputs.isInputPrimary(i))
PrimaryBufferID = BufferID;
return false;