Navigation Menu

Skip to content

Commit

Permalink
ECC: Add progress indicator of file name for time-consuming checks; C…
Browse files Browse the repository at this point in the history
…ache include files for FullFileNames to improve check speed.

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1265 7335b38e-4728-0410-8992-fb3ffe349368
  • Loading branch information
jlin16 committed Jun 19, 2008
1 parent d6356d0 commit 7305ee6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Python/Ecc/Check.py
Expand Up @@ -108,6 +108,7 @@ def FunctionLayoutCheckPrototype(self):
for F in Filenames:
if os.path.splitext(F)[1] in ('.c'):
FullName = os.path.join(Dirpath, F)
EdkLogger.quiet("[PROTOTYPE]" + FullName)
c.CheckFuncLayoutPrototype(FullName)

# Check whether the body of a function is contained by open and close braces that must be in the first column
Expand Down Expand Up @@ -280,6 +281,7 @@ def PredicateExpressionCheckBooleanValue(self):
for F in Filenames:
if os.path.splitext(F)[1] in ('.c'):
FullName = os.path.join(Dirpath, F)
EdkLogger.quiet("[BOOLEAN]" + FullName)
c.CheckBooleanValueComparison(FullName)
# Check whether Non-Boolean comparisons use a compare operator (==, !=, >, < >=, <=).
def PredicateExpressionCheckNonBooleanOperator(self):
Expand All @@ -294,6 +296,7 @@ def PredicateExpressionCheckNonBooleanOperator(self):
for F in Filenames:
if os.path.splitext(F)[1] in ('.c'):
FullName = os.path.join(Dirpath, F)
EdkLogger.quiet("[NON-BOOLEAN]" + FullName)
c.CheckNonBooleanValueComparison(FullName)
# Check whether a comparison of any pointer to zero must be done via the NULL type
def PredicateExpressionCheckComparisonNullType(self):
Expand All @@ -308,6 +311,7 @@ def PredicateExpressionCheckComparisonNullType(self):
for F in Filenames:
if os.path.splitext(F)[1] in ('.c'):
FullName = os.path.join(Dirpath, F)
EdkLogger.quiet("[POINTER]" + FullName)
c.CheckPointerNullComparison(FullName)
#
# Include file checking
Expand Down
6 changes: 6 additions & 0 deletions Source/Python/Ecc/c.py
Expand Up @@ -11,6 +11,7 @@
import MetaDataParser

IncludeFileListDict = {}
AllIncludeFileListDict = {}
IncludePathListDict = {}
ComplexTypeDict = {}
SUDict = {}
Expand Down Expand Up @@ -543,6 +544,9 @@ def GetFullPathOfIncludeFile(Str, IncludePathList):
return None

def GetAllIncludeFiles(FullFileName):
if AllIncludeFileListDict.get(FullFileName) != None:
return AllIncludeFileListDict.get(FullFileName)

IncludePathList = IncludePathListDict.get(os.path.dirname(FullFileName))
if IncludePathList == None:
IncludePathList = MetaDataParser.GetIncludeListOfFile(EccGlobalData.gWorkspace, FullFileName, GetDB())
Expand All @@ -569,6 +573,8 @@ def GetAllIncludeFiles(FullFileName):
if FullPath != None and FullPath not in IncludeFileQueue:
IncludeFileQueue.insert(i + 1, FullPath)
i += 1

AllIncludeFileListDict[FullFileName] = IncludeFileQueue
return IncludeFileQueue

def GetPredicateListFromPredicateExpStr(PES):
Expand Down

0 comments on commit 7305ee6

Please sign in to comment.