From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web09.5526.1576634939329904600 for ; Tue, 17 Dec 2019 18:08:59 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: bob.c.feng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Dec 2019 18:08:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,327,1571727600"; d="scan'208";a="217711179" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga006.jf.intel.com with ESMTP; 17 Dec 2019 18:08:58 -0800 From: "Bob Feng" To: devel@edk2.groups.io Cc: Liming Gao , Steven Shi Subject: [Patch 1/1] BaseTools: Remove PCD_TOKEN define for FixedAtBuild PCD Date: Wed, 18 Dec 2019 10:08:54 +0800 Message-Id: <20191218020854.49000-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2426 Build tool generate PCD_TOKEN_xxx Macro for FixedAtBuild Pcd in Autogen.c and Autogen.h but there is no code use that Macro, so this patch is going to remove this Macro from autogen files. This change can improve incremental build function. Cc: Liming Gao Cc: Steven Shi Signed-off-by: Bob Feng --- BaseTools/Source/Python/AutoGen/GenC.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py index 5e0d11e165a3..3ec1a950fadc 100755 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -911,11 +911,12 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd): EdkLogger.error("build", AUTOGEN_ERROR, "No generated token number for %s.%s\n" % (Pcd.TokenSpaceGuidCName, TokenCName), ExtraData="[%s]" % str(Info)) else: TokenNumber = PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] - AutoGenH.Append('\n#define %s %dU\n' % (PcdTokenName, TokenNumber)) + if Pcd.Type in PCD_DYNAMIC_TYPE_SET: + AutoGenH.Append('\n#define %s %dU\n' % (PcdTokenName, TokenNumber)) EdkLogger.debug(EdkLogger.DEBUG_3, "Creating code for " + TokenCName + "." + Pcd.TokenSpaceGuidCName) if Pcd.Type not in gItemTypeStringDatabase: EdkLogger.error("build", AUTOGEN_ERROR, "Unknown PCD type [%s] of PCD %s.%s" % (Pcd.Type, Pcd.TokenSpaceGuidCName, TokenCName), @@ -1236,11 +1237,12 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd): AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName)) else: AutoGenH.Append('#define %s(Value) LibPcdSetEx%s(&%s, %s, (Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName)) AutoGenH.Append('#define %s(Value) LibPcdSetEx%sS(&%s, %s, (Value))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName)) else: - AutoGenH.Append('#define _PCD_TOKEN_%s %dU\n' % (TokenCName, TokenNumber)) + if Pcd.Type in PCD_DYNAMIC_TYPE_SET: + AutoGenH.Append('#define _PCD_TOKEN_%s %dU\n' % (TokenCName, TokenNumber)) if PcdItemType in PCD_DYNAMIC_TYPE_SET: PcdList = [] PcdCNameList = [] PcdList.extend(Info.LibraryPcdList) PcdList.extend(Info.ModulePcdList) -- 2.20.1.windows.1