Commit Graph

1353 Commits

Author SHA1 Message Date
Philipp Schuster e0184abff1 BaseTools: fix various typos
This commit is the first in a series of multiple commits to fix various
typos in the code, originating mostly from copy&paste over the years.

Most of them only affect documentation and not code.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
2025-11-21 21:49:59 +00:00
Sathya Ravichandran 98d1f8a6fd BaseTools: Remove DXE_SAL_DRIVER
The DXE_SAL_DRIVER module type was introduced to support
Itanium (IPF) platforms. Since support for Itanium processors has been
dropped, the instances of DXE_SAL_DRIVER have been removed.

Ref: [3cb0a311cb]

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Sathya Ravichandran <sathyar@ami.com>
2025-10-30 10:00:32 +00:00
Ashraf Ali S e494b25fe3 BaseTools:Remove deprecated ast.Str import for Python 3.14 compatibility
- Str is not being used in FvHeader.py
- Removed import of ast.Str as it was removed in Python 3.14.
- Ensures compatibility with Python 3.14 and later.
- https://docs.python.org/3/whatsnew/3.14.html#id9

This addresses ImportError caused by removal of deprecated AST classes
including ast.Str.

Signed-off-by: Ashraf Ali S <ashraf.ali.s@intel.com>
2025-10-21 02:45:38 +00:00
Phil Noh 1e7a83cbb6 BaseTools/FMMT: Fix errors when operating the FV with CRC32 section
Currently the FMMT tool supports CRC32 GUID section (Ref. GuidTools.py).
But it is found that there are errors for the FV with CRC32 section.
For example, the errors are checked on the following commands.

--v : Show FV information except for the FV
--a : Show "Target Fv not found!!!" when adding an FFS file to the FV
--d : Show "Target Ffs not found!!!" when deleting an FFS file in the FV

They are caused by the mismatch for CRC32 section data between the FMMT
and GenCrc32 tools. The FMMT tool returns CRC32 section data without CRC
checksum field (4 bytes). The GenCrc32 tool (with -d option, verify CRC32
value for the input file) requires CRC32 section data including CRC
checksum field (4 bytes).

Fix the issue through adjusting the section data to include CRC checksum
field. Currently DataOffset field for CRC32 GUID section is reported as
0x1C differently (GUID Section header length: 0x18 + Checksum field: 0x4).
Instead of DataOffset field that includes CRC checksum field, configure
the section data based on the offset from section header length (0x18)
that was previously calculated. This update enables GUID sections to use
the same offset consistently.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2025-10-16 14:14:06 +00:00
Leif Lindholm fcc568ca6e BaseTools/build.py: set BUILD_TIME_EPOCH if not already in environment
Set BUILD_TIME_EPOCH to the current UTC timestamp if not already present
in the environment.

Use the resulting value to print the "Build start time:" message.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-10-16 10:41:09 +00:00
Leif Lindholm 5ca97bf64f BaseTools/build.py: language cleanup around CheckEnvVariable
The function CheckEnvVariable in fact checks several environment
variables. And the comment at its invocation enumerates a specific set of
variables, which defeats half the point of abstracting it out into a
helper function.

Rename the function to the plural form and turn the comment into a list
of examples.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-10-16 10:41:09 +00:00
Oliver Smith-Denny 2ff173af12 BaseTools: Remove ARM32 Support
edk2 is dropping support for the ARM32 architecture. This
commit removes ARM32 code from BaseTools.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-25 22:04:10 +00:00
Sergii Dmytruk 433bbe6e49 BaseTools: DSC: fix processing !include in multiarch subsections
Commit f0a2015373 ("UefiPayloadPkg: Add AARCH64 support") changed
`[Components.X64]` to `[Components.X64, Components.AARCH64]` which
resulted in the following code within that section to not work as
expected (the code wasn't there, just providing a real world example
that uncovered the issue):

[Components.X64, Components.AARCH64]
    FmpDevicePkg/FmpDxe/FmpDxe.inf {
      ...
      <PcdsFixedAtBuild>
        !include .../...PcdFmpDevicePkcs7CertBufferXdr.inc
      ...
    }

At the same time `[Components.X64]` or even `[Components.AARCH64,
Components.X64]` (notice the swapped order) worked fine for X64 target.

The cause of the issue turned out to be skipping includes inside
`_PostProcess()` method of `DscParser` class.  This method processes
list of items stored in a database filled on the first pass through a
DSC file in `Start()` method.  One of the fields stored in each row
of a table is link to a parent object (owner).  A section like
`[Components.X64, Components.AARCH64]` creates two objects and all of
its subelements are duplicated for both X64 and AARCH64.  This was not
happening for !include statement in the example above.

Because `_PostProcess()` contracted a sequence of !include objects
disregarding their owner, it did not create instance for each of the
requested targets.  Codewise, `self._ContentIndex` was incremented more
than once, while `__ProcessDirective()` method (invoked indirectly as
`Processer[self._ItemType]()`) queried owner of the current directive
as:

    if self._InSubsection:
        Owner = self._Content[self._ContentIndex - 1][8]
    else: # not taken in this case

This is why order of targets made a difference, only the last was fully
initialized in this case.

An alternative fix is completely dropping merging of !include
directives, but hard to say whether it still has some utility (the code
is complex, hard to follow and barely documented).  Safer to keep it, in
the worst case it doesn't do anything now.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-08-25 11:54:17 +00:00
Yuwei Chen a60334ad59 BaseTools: Fix FMMT FvHandler Padding operation issue
When using the FMMT FvHandler function, new padding size
should be calculated correctly comparing with origin ffs
and new ffs, else it will cause the binary size changes.
This patch is used to fix the bug.

Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
2025-07-30 02:44:25 +00:00
Aaron Pop 0277d5d8f1 BaseTools: Improve report generation for Nested Fvs.
Build report would not detect a nested FV if the nested
FV was not in a subsection of an FFS statement.

Modify the build report to better handle some of the
variations of nested FVs.

Failing Example:

[Fv.FvName1]
  INF <path to some driver>.inf

[Fv.FvName0]
  FILE FV_IMAGE = B25ACDEF-39CE-4FA5-B50A-33E24DB1BDDF {
    SECTION FV_IMAGE = FvName1
  }

Working Example:

[Fv.FvName1]
  INF <path to some driver>.inf

[Fv.FvName0]
FILE FV_IMAGE = DA04F6BF-A0FD-47EC-928B-5101A6C95026 {
  SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF
    PROCESSING_REQUIRED = TRUE {
      SECTION FV_IMAGE = FvName1
  }
}

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
2025-07-08 10:06:36 +08:00
Abdul Lateef Attar 4be603d713 BaseTools: Fix the spelling or typo
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-07-04 09:41:47 +08:00
Pierre Gondois 2d6b8d5ac9 BaseTools: WorkSpace: Remove unnecessary code
Running the vulture tool on the WorkSpace folder gave the following
report. Remove the unnecessary code.

- Workspace/BuildClassObject.py:148:
  unused method 'IsSimpleTypeArray' (60% confidence)
- Workspace/BuildClassObject.py:337:
  unused method 'SetPcdMode' (60% confidence)
- Workspace/BuildClassObject.py:612:
  unused attribute 'DscSpecification' (60% confidence)
- Workspace/DscBuildData.py:451:
  unused property 'DscSpecification' (60% confidence)
- Workspace/DscBuildData.py:1253:
  unused method 'GetBuildOptionsByPkg' (60% confidence)
- Workspace/DscBuildData.py:2064:
  unused method 'GetStarNum' (60% confidence)
- Workspace/DscBuildData.py:3613:
  unused method 'AddModule' (60% confidence)
- Workspace/DscBuildData.py:3650:
  unused method 'AddPcd' (60% confidence)
- Workspace/InfBuildData.py:117:
  unused attribute '_TailComments' (60% confidence)
- Workspace/InfBuildData.py:126:
  unused attribute '_BinaryModule' (60% confidence)
- Workspace/MetaDataTable.py:114:
  unused method 'IsIntegral' (60% confidence)
- Workspace/MetaDataTable.py:218:
  unused method 'GetFileTimeStamp' (60% confidence)
- Workspace/MetaDataTable.py:230:
  unused method 'SetFileTimeStamp' (60% confidence)
- Workspace/MetaDataTable.py:298:
  unused method 'GetCrossIndex' (60% confidence)
- Workspace/MetaFileParser.py:161:
  unused attribute '_FileDir' (60% confidence)
- Workspace/MetaFileParser.py:1187:
  unused method '_DecodeCODEData' (60% confidence)
- Workspace/MetaFileParser.py:1796:
  unused attribute '_RestofValue' (60% confidence)
- Workspace/MetaFileTable.py:31:
  unused attribute '_NumpyTab' (60% confidence)
- Workspace/WorkspaceDatabase.py:136:
  unused class 'TransformObjectFactory' (60% confidence)
- Workspace/WorkspaceDatabase.py:159:
  unused attribute 'TransformObject' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois 70d53c2df0 BaseTools: UPT/Library: Remove unnecessary code
Running the vulture tool on the UPT/Library folder gave the following
report. Remove the unnecessary code.

- UPT/Library/CommentGenerating.py:50:
  unused function 'GenGenericComment' (60% confidence)
- UPT/Library/CommentGenerating.py:172:
  unused function 'GenInfPcdTailComment' (60% confidence)
- UPT/Library/CommentGenerating.py:185:
  unused function 'GenInfProtocolPPITailComment' (60% confidence)
- UPT/Library/CommentGenerating.py:203:
  unused function 'GenInfGuidTailComment' (60% confidence)
- UPT/Library/Misc.py:504:
  unused class 'MergeCommentDict' (60% confidence)
- UPT/Library/Misc.py:527:
  unused function 'GenDummyHelpTextObj' (60% confidence)
- UPT/Library/ParserValidate.py:110:
  unused function 'IsValidInfComponentType' (60% confidence)
- UPT/Library/ParserValidate.py:122:
  unused function 'IsValidToolFamily' (60% confidence)
- UPT/Library/ParserValidate.py:134:
  unused function 'IsValidToolTagName' (60% confidence)
- UPT/Library/ParserValidate.py:465:
  unused function 'IsValidBuildNumber' (60% confidence)
- UPT/Library/ParserValidate.py:478:
  unused function 'IsValidDepex' (60% confidence)
- UPT/Library/ParserValidate.py:546:
  unused function 'IsValidVersionString' (60% confidence)
- UPT/Library/ParserValidate.py:721:
  unused function 'CheckUTF16FileHeader' (60% confidence)
- UPT/Library/Parsing.py:52:
  unused function 'GetBuildOption' (60% confidence)
- UPT/Library/Parsing.py💯
  unused function 'GetLibraryClassOfInf' (60% confidence)
- UPT/Library/Parsing.py:150:
  unused function 'GetPcd' (60% confidence)
- UPT/Library/Parsing.py:177:
  unused function 'GetFeatureFlagPcd' (60% confidence)
- UPT/Library/Parsing.py:201:
  unused function 'GetDynamicDefaultPcd' (60% confidence)
- UPT/Library/Parsing.py:227:
  unused function 'GetDynamicHiiPcd' (60% confidence)
- UPT/Library/Parsing.py:254:
  unused function 'GetDynamicVpdPcd' (60% confidence)
- UPT/Library/Parsing.py:277:
  unused function 'GetComponent' (60% confidence)
- UPT/Library/Parsing.py:392:
  unused function 'GetExec' (60% confidence)
- UPT/Library/Parsing.py:416:
  unused function 'GetComponents' (60% confidence)
- UPT/Library/Parsing.py:532:
  unused function 'GetSource' (60% confidence)
- UPT/Library/Parsing.py:581:
  unused function 'GetGuidsProtocolsPpisOfInf' (60% confidence)
- UPT/Library/Parsing.py:595:
  unused function 'GetGuidsProtocolsPpisOfDec' (60% confidence)
- UPT/Library/Parsing.py:645:
  unused function 'GetPcdOfInf' (60% confidence)
- UPT/Library/Parsing.py:682:
  unused function 'GetPcdOfDec' (60% confidence)
- UPT/Library/Parsing.py:739:
  unused function 'InsertSectionItems' (60% confidence)
- UPT/Library/Parsing.py:776:
  unused function 'GenMetaDatSectionItem' (60% confidence)
- UPT/Library/StringUtils.py:87:
  unused function 'GetLibraryClassesWithModuleType' (60% confidence)
- UPT/Library/StringUtils.py:107:
  unused function 'GetDynamics' (60% confidence)
- UPT/Library/StringUtils.py:350:
  unused function 'GetMultipleValuesOfKeyFromLines' (60% confidence)
- UPT/Library/StringUtils.py:396:
  unused function 'GetSingleValueOfKeyFromLines' (60% confidence)
- UPT/Library/StringUtils.py:463:
  unused function 'PreCheck' (60% confidence)
- UPT/Library/StringUtils.py:675:
  unused function 'StringArrayLength' (60% confidence)
- UPT/Library/StringUtils.py:718:
  unused function 'IsHexDigit' (60% confidence)
- UPT/Library/UniClassObject.py:86:
  unused function 'UniToStr' (60% confidence)
- UPT/Library/UniClassObject.py:227:
  unused attribute 'StringNameByteList' (60% confidence)
- UPT/Library/UniClassObject.py:237:
  unused attribute 'StringNameByteList' (60% confidence)
- UPT/Library/UniClassObject.py:377:
  unused method 'GetIncludeFile' (60% confidence)
- UPT/Library/UniClassObject.py:947:
  unused method 'FindStringValue' (60% confidence)
- UPT/Library/UniClassObject.py:957:
  unused method 'FindByToken' (60% confidence)
- UPT/Library/UniClassObject.py:1022:
  unused method 'ReadIncludeUNIfile' (60% confidence)
- UPT/Library/StringUtils.py:718:
  unused function 'IsHexDigit' (60% confidence)
- UPT/Library/Xml/XmlRoutines.py:176:
  unused function 'XmlElementList' (60% confidence)
- UPT/Library/Xml/XmlRoutines.py:202:
  unused function 'XmlNodeName' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois 5c558ce5f3 BaseTools: UPT/Xml: Remove unnecessary code
Running the vulture tool on the UPT/Xml folder gave the following
report. Remove the unnecessary code.

- UPT/Xml/CommonXml.py:585:
  unused attribute 'LangDefsList' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois 9b52f0c205 BaseTools: UPT/PomAdapter: Remove unnecessary code
Running the vulture tool on the UPT/PomAdapter folder gave the following
report. Remove the unnecessary code.

- UPT/PomAdapter/DecPomAlignment.py:898:
  unused method 'ShowPackage' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois 583b64122c BaseTools: UPT/Parser: Remove unnecessary code
Running the vulture tool on the UPT/Parser folder gave the following
report. Remove the unnecessary code.

- UPT/Parser/InfAsBuiltProcess.py:223:
  unused function 'GetInfsFromWorkSpace' (60% confidence)
- UPT/Parser/InfAsBuiltProcess.py:237:
  unused function 'GetGuidVerFormLibInstance' (60% confidence)
- UPT/Parser/InfParserMisc.py:211:
  unused attribute 'InfPeiDepexSection' (60% confidence)
- UPT/Parser/InfParserMisc.py:212:
  unused attribute 'InfDxeDepexSection' (60% confidence)
- UPT/Parser/InfParserMisc.py:213:
  unused attribute 'InfSmmDepexSection' (60% confidence)
- UPT/Parser/InfSectionParser.py:231:
  unused attribute 'InfPeiDepexSection' (60% confidence)
- UPT/Parser/InfSectionParser.py:232:
  unused attribute 'InfDxeDepexSection' (60% confidence)
- UPT/Parser/InfSectionParser.py:233:
  unused attribute 'InfSmmDepexSection' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois ee79100678 BaseTools: Table: Remove unnecessary code
Running the vulture tool on the Table folder gave the following
report. Remove the unnecessary code.

- Table/Table.py:88:
  unused method 'GenerateID' (60% confidence)
- Table/TableDataModel.py:83:
  unused method 'GetCrossIndex' (60% confidence)
- Table/TableEotReport.py:66:
  unused method 'GetMaxID' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois fa2c27514c BaseTools: GenFds: Remove unnecessary code
Running the vulture tool on the GenFds folder gave the following
report. Remove the unnecessary code.

- GenFds/Fd.py:146:
  unused method 'GenFlashMap' (60% confidence)
- GenFds/FdfParser.py:1539:
  unused attribute 'BaseAddressPcd' (60% confidence)
- GenFds/FdfParser.py:1556:
  unused attribute 'SizePcd' (60% confidence)
- GenFds/FdfParser.py:2394:
  unused attribute 'CurrentLineNum' (60% confidence)
- GenFds/FdfParser.py:2395:
  unused attribute 'CurrentLineContent' (60% confidence)
- GenFds/FdfParser.py:2653:
  unused attribute 'CurrentLineNum' (60% confidence)
- GenFds/FdfParser.py:2654:
  unused attribute 'CurrentLineContent' (60% confidence)
- GenFds/FdfParser.py:3229:
  unused attribute 'CreateFile' (60% confidence)
- GenFds/FfsFileStatement.py:36:
  unused attribute 'CurrentLineNum' (60% confidence)
- GenFds/FfsFileStatement.py:37:
  unused attribute 'CurrentLineContent' (60% confidence)
- GenFds/FfsInfStatement.py:68:
  unused attribute 'CurrentLineNum' (60% confidence)
- GenFds/FfsInfStatement.py:69:
  unused attribute 'CurrentLineContent' (60% confidence)
- GenFds/GenFds.py:68:
  unused attribute 'LibDir' (60% confidence)
- GenFds/GenFds.py:557:
  unused method 'GetFvBlockSize' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois ff0162bf07 BaseTools: FMTT: Remove unnecessary code
Running the vulture tool on the FMTT folder gave the following
report. Remove the unnecessary code.

- FMMT/core/BinaryFactoryProduct.py:132:
  unused attribute 'ROffset' (60% confidence)
- FMMT/core/BinaryFactoryProduct.py:176:
  unused attribute 'ROffset' (60% confidence)
- FMMT/core/BinaryFactoryProduct.py:229:
  unused attribute 'ROffset' (60% confidence)
- FMMT/core/BinaryFactoryProduct.py:365:
  unused class 'ElfSectionProduct' (60% confidence)
- FMMT/core/BinaryFactoryProduct.py:369:
  unused method 'ParserSectionData' (60% confidence)
- FMMT/core/BinaryFactoryProduct.py:371:
  unused method 'ParserProgramData' (60% confidence)
- FMMT/core/BiosTree.py:76:
  unused method 'insertRel' (60% confidence)
- FMMT/core/BiosTree.py:84:
  unused method 'deleteNode' (60% confidence)
- FMMT/core/BiosTreeNode.py:63:
  unused attribute 'ROffset' (60% confidence)
- FMMT/core/BiosTreeNode.py:125:
  unused attribute 'ROffset' (60% confidence)
- FMMT/core/BiosTreeNode.py:182:
  unused attribute 'ROffset' (60% confidence)
- FMMT/core/BiosTreeNode.py:185:
  unused attribute 'SectionMaxAlignment' (60% confidence)
- FMMT/core/BiosTreeNode.py:220:
  unused attribute 'ROffset' (60% confidence)
- FMMT/core/BiosTreeNode.py:223:
  unused attribute 'OriHeader' (60% confidence)
- FMMT/core/BiosTreeNode.py:226:
  unused attribute 'SectionMaxAlignment' (60% confidence)
- FMMT/core/BiosTreeNode.py:247:
  unused attribute 'ROffset' (60% confidence)
- FMMT/FMMT.py:52:
  unused attribute 'firmware_packet' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois 3c2f04a3c7 BaseTools: Eot: Remove unnecessary code
Running the vulture tool on the Eot folder gave the following
report. Remove the unnecessary code.

- Eot/CodeFragment.py:47:
  unused class 'AssignmentExpression' (60% confidence)
- Eot/CodeFragmentCollector.py:75:
  unused attribute '__Token' (60% confidence)
- Eot/CodeFragmentCollector.py:76:
  unused attribute '__SkippedChars' (60% confidence)
- Eot/CodeFragmentCollector.py:104:
  unused method '__EndOfLine' (60% confidence)
- Eot/CodeFragmentCollector.py:129:
  unused method '__UndoOneChar' (60% confidence)
- Eot/CodeFragmentCollector.py:215:
  unused method '__InsertComma' (60% confidence)
- Eot/Database.py:81:
  unused attribute 'text_factory' (60% confidence)
- Eot/EotMain.py:1012:
  unused method 'SetFreeSpace' (60% confidence)
- Eot/Identification.py:36:
  unused method 'GetFileFullPath' (60% confidence)
- Eot/Identification.py:43:
  unused method 'GetFileRelativePath' (60% confidence)
- Eot/Parser.py:119:
  unused function 'AddToGlobalMacro' (60% confidence)
- Eot/Parser.py:238:
  unused function 'GetAllSourceFiles' (60% confidence)
- Eot/Parser.py:257:
  unused function 'ParseConditionalStatementMacros' (60% confidence)
- Eot/Parser.py:267:
  unused function 'GetAllFiles' (60% confidence)
- Eot/Parser.py:291:
  unused function 'ParseConditionalStatement' (60% confidence)
- Eot/Parser.py:367:
  unused function 'GetConditionalStatementStatus' (60% confidence)
- Eot/Parser.py:722:
  unused function 'ConvertGuid' (60% confidence)
- Eot/Parser.py:857:
  unused function 'ConvertGuid2' (60% confidence)
- Eot/Report.py:161:
  unused method 'GeneratePpi' (60% confidence)
- Eot/Report.py:173:
  unused method 'GenerateProtocol' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois 7402bd06cf BaseTools: Ecc: Remove unnecessary code
Running the vulture tool on the Ecc folder gave the following
report. Remove the unnecessary code.

- Ecc/c.py:52:
  unused function 'GetConfig' (60% confidence)
- Ecc/c.py:484:
  unused function 'GetFileModificationTimeFromDB' (60% confidence)
- Ecc/CodeFragmentCollector.py:77:
  unused attribute '__Token' (60% confidence)
- Ecc/CodeFragmentCollector.py:78:
  unused attribute '__SkippedChars' (60% confidence)
- Ecc/CodeFragmentCollector.py:109:
  unused method '__EndOfLine' (60% confidence)
- Ecc/CodeFragmentCollector.py:134:
  unused method '__UndoOneChar' (60% confidence)
- Ecc/CodeFragmentCollector.py:221:
  unused method '__InsertComma' (60% confidence)
- Ecc/CodeFragmentCollector.py:539:
  unused method 'PrintFragments' (60% confidence)
- Ecc/Database.py:81:
  unused attribute 'text_factory' (60% confidence)
- Ecc/Database.py:214:
  unused method 'UpdateIdentifierBelongsToFunction_disabled'
  (60% confidence)
- Ecc/MetaFileWorkspace/MetaDataTable.py:142:
  unused method 'IsIntegral' (60% confidence)
- Ecc/MetaFileWorkspace/MetaDataTable.py:205:
  unused method 'GetCrossIndex' (60% confidence)
- Ecc/Xml/XmlRoutines.py:145:
  unused function 'XmlElementData' (60% confidence)
- Ecc/Xml/XmlRoutines.py:162:
  unused function 'XmlElementList' (60% confidence)
- Ecc/Xml/XmlRoutines.py:192:
  unused function 'XmlNodeName' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois c6e088cafc BaseTools: Capsule: Remove unnecessary code
Running the vulture tool on the Capsule folder gave the following
report. Remove the unnecessary code.

- Capsule/WindowsCapsuleSupportHelper.py:26:
  unused method 'RegisterHelpers' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois ac9dc33396 BaseTools: build: Remove unnecessary code
Running the vulture tool on the build folder gave the following
report. Remove the unnecessary code.

- build/build.py:79:
  unused function 'IsToolInPath' (60% confidence)
- build/build.py:396:
  unused class 'PlatformMakeUnit' (60% confidence)
- build/build.py:570:
  unused method 'GetErrorMessage' (60% confidence)
- build/build.py:806:
  unused attribute 'HashSkipModules' (60% confidence)
- build/build.py:807:
  unused attribute 'Db_Flag' (60% confidence)
- build/build.py:1048:
  unused attribute 'Db_Flag' (60% confidence)
- build/build.py:2500:
  unused method 'GetRealPathOfTool' (60% confidence)
- build/BuildReport.py:1497:
  unused method 'StrtoHex' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois f79717aac2 BaseTools: AutoGen: Remove unnecessary code
Running the vulture tool on the AutoGen folder gave the following
report. Remove the unnecessary code.

- AutoGen/BuildEngine.py:333:
  unused attribute 'SupportedToolChainFamilyList' (60% confidence)
- AutoGen/BuildEngine.py:346:
  unused attribute '_RuleObjectList' (60% confidence)
- AutoGen/GenMake.py:450:
  unused attribute 'FileBuildTargetList' (60% confidence)
- AutoGen/GenMake.py:452:
  unused attribute 'PendingBuildTargetList' (60% confidence)
- AutoGen/GenMake.py:458:
  unused attribute 'LibraryBuildCommandList' (60% confidence)
- AutoGen/GenMake.py:459:
  unused attribute 'LibraryFileList' (60% confidence)
- AutoGen/GenMake.py:462:
  unused attribute 'SystemLibraryList' (60% confidence)
- AutoGen/GenMake.py:1168:
  unused method 'GetFileDependency' (60% confidence)
- AutoGen/GenMake.py:1466:
  unused attribute 'ModuleBuildCommandList' (60% confidence)
- AutoGen/GenPcdDb.py:442:
  unused class 'DbSkuHeadTableItemList' (60% confidence)
- AutoGen/GenVar.py:31:
  unused attribute 'VpdRegionOffset' (60% confidence)
- AutoGen/GenVar.py:43:
  unused attribute 'VpdRegionOffset' (60% confidence)
- AutoGen/ModuleAutoGen.py:257:
  unused attribute 'FileDependCache' (60% confidence)
- AutoGen/ModuleAutoGen.py:684:
  unused method 'BuildOptionIncPathList' (60% confidence)
- AutoGen/PlatformAutoGen.py:994:
  unused method 'EdkBuildOption' (60% confidence)
- AutoGen/UniClassObject.py:171:
  unused attribute 'StringNameByteList' (60% confidence)
- AutoGen/UniClassObject.py:181:
  unused attribute 'StringNameByteList' (60% confidence)
- AutoGen/UniClassObject.py:366:
  unused method 'GetIncludeFile' (60% confidence)
- AutoGen/UniClassObject.py:606:
  unused method 'FindStringValue' (60% confidence)
- AutoGen/UniClassObject.py:616:
  unused method 'FindByToken' (60% confidence)
- AutoGen/ValidCheckingInfoObject.py:228:
  unused attribute 'ValidData' (60% confidence)
- AutoGen/ValidCheckingInfoObject.py:231:
  unused attribute 'ValidData' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00
Pierre Gondois c169a5420b BaseTools: Remove unreachable code
Running the vulture tool gave the following report.
Remove the unreachable code.

- TargetTool/TargetTool.py:49:
  unreachable code after 'raise' (100% confidence)
- UPT/Library/UniClassObject.py:137:
  unreachable code after 'return' (100% confidence)
- UPT/Object/Parser/InfDefineObject.py:795:
  unreachable code after 'if' (100% confidence)
- Ecc/Check.py:1504:
  unreachable code after 'return' (100% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00