[llvm] r259255 - Need #include <cstdint> for uint64_t

mats petersson via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 29 17:02:43 PST 2016


Sounds to me like including `DataTypes.h` would be the right choice, since
it will include `stdint.h` if it exists - and error if it doesn't, along
with a few other things. And it guarantees that the entire compiler uses
the SAME definition, rather than, potentially, using different variants of
the "same" type in different places.

I'd argue the other way around, that you probably should fix the other bits
that use `cstdint` to use `DataTypes.h`.

--
Mats

On 30 January 2016 at 00:33, Matthias Braun via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Oh I did not know about DataTypes.h. However given that there are already
> two other files in llvm (in the AMDGPU and Hexagon targets) that #include
> <cstdint> since 2014, maybe we can loosen the requirement for DataTypes.h
> nowadays as #include <cstdint> seems to be working everywhere?
>
> - Matthias
>
> On Jan 29, 2016, at 3:06 PM, Craig Topper <craig.topper at gmail.com> wrote:
>
> I think you may really want include/llvm/Support/DataTypes.h
>
> On Fri, Jan 29, 2016 at 2:35 PM, Matthias Braun via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: matze
>> Date: Fri Jan 29 16:35:29 2016
>> New Revision: 259255
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=259255&view=rev
>> Log:
>> Need #include <cstdint> for uint64_t
>>
>> Modified:
>>     llvm/trunk/lib/IR/AttributeImpl.h
>>
>> Modified: llvm/trunk/lib/IR/AttributeImpl.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AttributeImpl.h?rev=259255&r1=259254&r2=259255&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/IR/AttributeImpl.h (original)
>> +++ llvm/trunk/lib/IR/AttributeImpl.h Fri Jan 29 16:35:29 2016
>> @@ -19,8 +19,9 @@
>>  #include "llvm/ADT/FoldingSet.h"
>>  #include "llvm/IR/Attributes.h"
>>  #include "llvm/Support/TrailingObjects.h"
>> -#include <string>
>>  #include <climits>
>> +#include <cstdint>
>> +#include <string>
>>
>>  namespace llvm {
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
>
>
> --
> ~Craig
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160130/dc258bd0/attachment.html>


More information about the llvm-commits mailing list