From ff4d0f851d43a0ad70a87e8b74b7303fc215361f Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Mon, 15 Oct 2018 21:20:00 +0800 Subject: BaseTools: Support to use struct name as datum type before max size Original it hard code to use "VOID*", this patch extend it to both support VOID* and valid struct name. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/Common/Misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/Common/Misc.py') diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index 6abbb9a944..b32b7cdc5f 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -50,6 +50,8 @@ valuePatternGcc = re.compile('^([\w_\.]+) +([\da-fA-Fx]+) +([\da-fA-Fx]+)$') pcdPatternGcc = re.compile('^([\da-fA-Fx]+) +([\da-fA-Fx]+)') secReGeneral = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\da-fA-F]+)[Hh]? +([.\w\$]+) +(\w+)', re.UNICODE) +StructPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*$') + ## Dictionary used to store file time stamp for quick re-access gFileTimeStampCache = {} # {file path : file time stamp} @@ -1459,7 +1461,7 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''): Size = '' if len(FieldList) > 1 and FieldList[1]: DataType = FieldList[1] - if FieldList[1] != TAB_VOID: + if FieldList[1] != TAB_VOID and StructPattern.match(FieldList[1]) is None: IsValid = False if len(FieldList) > 2: Size = FieldList[2] -- cgit v1.2.3