File tree Expand file tree Collapse file tree 2 files changed +12
-24
lines changed Expand file tree Collapse file tree 2 files changed +12
-24
lines changed Original file line number Diff line number Diff line change @@ -576,10 +576,6 @@ class CompilerInstance {
576
576
void setupDependencyTrackerIfNeeded ();
577
577
Optional<unsigned > setUpCodeCompletionBuffer ();
578
578
579
- // / Set up all state in the CompilerInstance to process the given input file.
580
- // / Return true on error.
581
- bool setUpForInput (const InputFile &input);
582
-
583
579
// / Find a buffer for a given input file and ensure it is recorded in
584
580
// / SourceMgr, PartialModules, or InputSourceCodeBufferIDs as appropriate.
585
581
// / Return the buffer ID if it is not already compiled, or None if so.
Original file line number Diff line number Diff line change @@ -598,11 +598,20 @@ bool CompilerInstance::setUpInputs() {
598
598
// per-input setup.
599
599
const Optional<unsigned > codeCompletionBufferID = setUpCodeCompletionBuffer ();
600
600
601
- for (const InputFile &input :
602
- Invocation.getFrontendOptions ().InputsAndOutputs .getAllInputs ())
603
- if (setUpForInput (input))
601
+ const auto &Inputs =
602
+ Invocation.getFrontendOptions ().InputsAndOutputs .getAllInputs ();
603
+ for (const InputFile &input : Inputs) {
604
+ bool failed = false ;
605
+ Optional<unsigned > bufferID = getRecordedBufferID (input, failed);
606
+ if (failed)
604
607
return true ;
605
608
609
+ if (!bufferID.hasValue () || !input.isPrimary ())
610
+ continue ;
611
+
612
+ recordPrimaryInputBuffer (*bufferID);
613
+ }
614
+
606
615
// Set the primary file to the code-completion point if one exists.
607
616
if (codeCompletionBufferID.hasValue () &&
608
617
!isPrimaryInput (*codeCompletionBufferID)) {
@@ -619,23 +628,6 @@ bool CompilerInstance::setUpInputs() {
619
628
return false ;
620
629
}
621
630
622
- bool CompilerInstance::setUpForInput (const InputFile &input) {
623
- bool failed = false ;
624
- Optional<unsigned > bufferID = getRecordedBufferID (input, failed);
625
- if (failed)
626
- return true ;
627
- if (!bufferID)
628
- return false ;
629
-
630
- if (isInputSwift () &&
631
- llvm::sys::path::filename (input.file ()) == " main.swift" ) {
632
- assert (MainBufferID == NO_SUCH_BUFFER && " re-setting MainBufferID" );
633
- MainBufferID = *bufferID;
634
- }
635
-
636
- if (input.isPrimary ()) {
637
- recordPrimaryInputBuffer (*bufferID);
638
- }
639
631
return false ;
640
632
}
641
633
You can’t perform that action at this time.
0 commit comments