From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.707.1584429237454559850 for ; Tue, 17 Mar 2020 00:13:57 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: zhiguang.liu@intel.com) IronPort-SDR: uVhEfBD1+MHxJQcXyp3OKUxR80M66SdzUKFPh2h0zgWs1LPpC22gVqYjHh6ZP7+QxXkrwWzg/O yQcyVsns5L/g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 00:13:56 -0700 IronPort-SDR: ZBe7anTfunQ7ITsTR6CkWtpEqI8MWGGmwytREDkuLH6yuVbJf9Swensrf8H8Lby7fwveROzZ1i l9G+pti8bpbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,563,1574150400"; d="scan'208";a="355280649" Received: from fieedk002.ccr.corp.intel.com ([10.239.158.178]) by fmsmga001.fm.intel.com with ESMTP; 17 Mar 2020 00:13:55 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao Subject: [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for CLANG Date: Tue, 17 Mar 2020 15:13:17 +0800 Message-Id: <20200317071317.959-1-zhiguang.liu@intel.com> X-Mailer: git-send-email 2.25.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1548 This change will make the generated image not include the absolute file pat= h. If so, the generated debug image can be reproduced in the different root directory. Also, it will reduce the size of debug image size. CC: Michael D Kinney CC: Liming Gao Signed-off-by: Zhiguang Liu --- MdePkg/Include/Library/DebugLib.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/Deb= ugLib.h index f1d55cf62b..baab34bf05 100644 --- a/MdePkg/Include/Library/DebugLib.h +++ b/MdePkg/Include/Library/DebugLib.h @@ -8,7 +8,7 @@ of size reduction when compiler optimization is disabled. If MDEPKG_NDEB= UG is=0D defined, then debug and assert related macros wrapped by it are the NULL= implementations.=0D =0D -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
=0D +Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D @@ -289,7 +289,11 @@ DebugPrintLevelEnabled ( @param Expression Boolean expression that evaluated to FALSE=0D =0D **/=0D +#if defined(__clang__) && defined(__FILE_NAME__)=0D +#define _ASSERT(Expression) DebugAssert (__FILE_NAME__, __LINE__, #Expres= sion)=0D +#else=0D #define _ASSERT(Expression) DebugAssert (__FILE__, __LINE__, #Expression)= =0D +#endif=0D =0D =0D /**=0D --=20 2.25.1.windows.1