public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 1/1] BaseTools: Remove PCD_TOKEN define for FixedAtBuild PCD
@ 2019-12-18  2:08 Bob Feng
  2019-12-18  2:15 ` [edk2-devel] " Liming Gao
  0 siblings, 1 reply; 3+ messages in thread
From: Bob Feng @ 2019-12-18  2:08 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Steven Shi

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 <liming.gao@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-18  2:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-18  2:08 [Patch 1/1] BaseTools: Remove PCD_TOKEN define for FixedAtBuild PCD Bob Feng
2019-12-18  2:15 ` [edk2-devel] " Liming Gao
2019-12-18  2:16   ` Bob Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox