<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60743>60743</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
_LP64 macro set incorrectly in clang/lib/Basic/Targets/AArch64.cpp
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
NickLewisL3H
</td>
</tr>
</table>
<pre>
The _LP64 macro is set in clang/lib/Basic/Targets/AArch64.cpp
`n_lewis@a009906:~/llvm-project$ tail +225 clang/lib/Basic/Targets/AArch64.cpp | head -5
// Target properties.
if (!getTriple().isOSWindows() && getTriple().isArch64Bit()) {
Builder.defineMacro("_LP64");
Builder.defineMacro("__LP64__");
}
`
I think this is incorrect for two reasons:
1. The setting of _LP64 is the responsibility of clang/lib/Frontend/InitPreprocessor.cpp
2. The AArch64.cpp code does not check that pointers and longs are actually 64bits. For example AArch64 Morello has 128 bit pointers
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU8tu4zgQ_Brq0oggknpYBx3sNYQNkOwG2AB7NCiqLfWGJgWSXo8v8-0DSc5jJphDLoREVlc1u1gqBBosYsOKHSv2iTrH0fnmL9IvD3ih8CD_TDrXX5vnEeHw8FTmcFLaO6AAASOQBW2UHZhoDXVMtDsVSDPRPis_YAxMtNut12OZp3qaWLZn2fa2lpk9mFmD5ZnKsrrOSia332cm8__pbvLuP9SRiRyiIgNM7IQovqIGrPoDRlQ93BWrJgATLRMtrHiYvJvQR8KQvgLoCExsmOADxmdPk8Hlt04p_P3Pv2R7dwnrDjBRMlHCZ-Dawo7iurNgq92rAsDuTKZHn_Z4JIuP8zwXpFgGzISYi-Rrwe_RC_xw-LUAWLV_m_H6cQ9xJPsyr2G2jqx23qOOcHQe4sWBRxWcDUze7OEpzJYHjJHsAO54c58CxBHBY5icDdSRoXidj382pvXORrQ9E-29pfjkcfJOYwjOvz8EsWp8tEy7HqF3GMC6CHpEPTetIkyObEQfQNkejLNDAOURlI5nZcwVyryjGFJonQf8pk6TeSOGR-fRGAejCsDFBjp650v6Rva1rFWCDS-rUm4KyatkbDItK76RldRVVWudy7rnWSV4yQXvMl4n1IhMyEzwnOey4FVa9TU_FoVQOe_wWGxYnuFJkUnn95w6PyQUwhmbMqtymRjVoQlL7oSweIHlcPay2Ce-WTLQnYc5HYZCDO8skaLB5mMY1yTeLDXXL6YyOXvTjDFOi_tLQAaK47lLtTvd4vgple3S7sy0XOdHAAAA__-y4VRp">