<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Georgia, serif; font-size: 11pt; color: rgb(0, 0, 0);"><span style="color: rgb(32, 31, 30); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">Hi
 Eli,</span><br style="color: rgb(32, 31, 30); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255)">
<br style="color: rgb(32, 31, 30); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255)">
<span style="color: rgb(32, 31, 30); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">Thank you, I think I'll
 move related code from CodeGenOptions to LangOptions then.</span><br style="color: rgb(32, 31, 30); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255)">
<br style="color: rgb(32, 31, 30); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255)">
<span style="color: rgb(32, 31, 30); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important">- Tamas</span><br>
</div>
<div style="font-family: Georgia, serif; font-size: 11pt; color: rgb(0, 0, 0);"><span style="color: rgb(32, 31, 30); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255); display: inline !important"><br>
</span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Eli Friedman <efriedma@quicinc.com><br>
<b>Sent:</b> Thursday, March 26, 2020 5:12 PM<br>
<b>To:</b> Tamas Petz <Tamas.Petz@arm.com>; cfe-dev@lists.llvm.org <cfe-dev@lists.llvm.org><br>
<b>Subject:</b> RE: [cfe-dev] Emit target specific defines based on CodeGenOptions</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">If an option has an effect on preprocessing/semantic analysis, it shouldn't be in CodeGenOptions; it should be in LangOptions.<br>
<br>
-Eli<br>
<br>
> -----Original Message-----<br>
> From: cfe-dev <cfe-dev-bounces@lists.llvm.org> On Behalf Of Tamas Petz via<br>
> cfe-dev<br>
> Sent: Thursday, March 26, 2020 1:36 AM<br>
> To: cfe-dev@lists.llvm.org<br>
> Subject: [EXT] [cfe-dev] Emit target specific defines based on CodeGenOptions<br>
><br>
> Dear List,<br>
><br>
> I am looking into adding some new Arm-specific feature test macros defined by<br>
> the latest release of ACLE:<br>
> <a href="https://developer.arm.com/docs/101028/0010/feature-test-macros">https://developer.arm.com/docs/101028/0010/feature-test-macros</a><br>
><br>
> Namely these are __ARM_FEATURE_BTI_DEFAULT<br>
> and __ARM_FEATURE_PAC_DEFAULT.<br>
><br>
> However, CodeGenOptions is not accessible from TargetInfo, as far as I can tell,<br>
> and there is no use-case for emitting such a define as of today.<br>
><br>
> I am asking for some advice how to implement it correctly.<br>
><br>
> I think there are three possible solutions:<br>
><br>
> 1. Refactor getTargetDefines() to have CodeGenOptions as argument, pass<br>
> CodeGenOptions through preprocessor.<br>
><br>
> 2. Use adjustTargetOptions(), remove const qualifier, store state in<br>
> AArch64TargetInfo, use stored state to generate macros.<br>
><br>
> 3. Add new virtual function to TargetInfo (getTargetDefinesCGO()?), pass<br>
> CodeGenOptions through preprocessor, invoke getTargetDefinesCGO() right<br>
> after getTargetDefines().<br>
><br>
> I would prefer option 1 but it is a massive diff.<br>
><br>
> What do you think? Is there a better way to achieve this?<br>
><br>
> Looking forward to you comments.<br>
><br>
> Best regards,<br>
> Tamas Petz<br>
><br>
> u.i.: should be there a disclaimer in this mail, please ignore it.<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> cfe-dev@lists.llvm.org<br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</div>
</span></font></div>
</body>
</html>