MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / Compile

Method Compile

BaseTools/Source/C/VfrCompile/VfrCompiler.cpp:660–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658extern UINT8 VfrParserStart (IN FILE *, IN INPUT_INFO_TO_SYNTAX *);
659
660VOID
661CVfrCompiler::Compile (
662 VOID
663 )
664{
665 FILE *pInFile = NULL;
666 CHAR8 *InFileName = NULL;
667 INPUT_INFO_TO_SYNTAX InputInfo;
668
669 if (!IS_RUN_STATUS(STATUS_PREPROCESSED)) {
670 goto Fail;
671 }
672
673 InFileName = (mOptions.SkipCPreprocessor == TRUE) ? mOptions.VfrFileName : mOptions.PreprocessorOutputFileName;
674
675 gCVfrErrorHandle.SetInputFile (InFileName);
676 gCVfrErrorHandle.SetWarningAsError(mOptions.WarningAsError);
677
678 if ((pInFile = fopen (LongFilePath (InFileName), "r")) == NULL) {
679 DebugError (NULL, 0, 0001, "Error opening the input file", "%s", InFileName);
680 goto Fail;
681 }
682
683 if (mOptions.HasOverrideClassGuid) {
684 InputInfo.OverrideClassGuid = &mOptions.OverrideClassGuid;
685 } else {
686 InputInfo.OverrideClassGuid = NULL;
687 }
688
689 if (VfrParserStart (pInFile, &InputInfo) != 0) {
690 goto Fail;
691 }
692
693 fclose (pInFile);
694 pInFile = NULL;
695
696 if (gCFormPkg.HavePendingUnassigned () == TRUE) {
697 gCFormPkg.PendingAssignPrintAll ();
698 goto Fail;
699 }
700
701 SET_RUN_STATUS (STATUS_COMPILEED);
702 return;
703
704Fail:
705 if (!IS_RUN_STATUS(STATUS_DEAD)) {
706 DebugError (NULL, 0, 0003, "Error parsing", "compile error in file %s", InFileName);
707 SET_RUN_STATUS (STATUS_FAILED);
708 }
709 if (pInFile != NULL) {
710 fclose (pInFile);
711 }
712}
713
714VOID
715CVfrCompiler::AdjustBin (

Callers 1

mainFunction · 0.80

Calls 7

fopenFunction · 0.85
fcloseFunction · 0.85
SetInputFileMethod · 0.80
SetWarningAsErrorMethod · 0.80
HavePendingUnassignedMethod · 0.80
PendingAssignPrintAllMethod · 0.80
LongFilePathFunction · 0.50

Tested by

no test coverage detected