File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -1459,16 +1459,11 @@ unsigned TargetLibraryInfoImpl::getWCharSize(const Module &M) const {
1459
1459
}
1460
1460
1461
1461
unsigned TargetLibraryInfoImpl::getSizeTSize (const Module &M) const {
1462
- // There is really no guarantee that sizeof(size_t) is equal to sizeof(int*).
1463
- // If that isn't true then it should be possible to derive the SizeTTy from
1464
- // the target triple here instead and do an early return.
1465
-
1466
- // Historically LLVM assume that size_t has same size as intptr_t (hence
1467
- // deriving the size from sizeof(int*) in address space zero). This should
1468
- // work for most targets. For future consideration: Hard coding address space
1469
- // zero here might be unfortunate. Maybe getMaxIndexSizeInBits() is better.
1470
- unsigned AddressSpace = 0 ;
1471
- return M.getDataLayout ().getIndexSizeInBits (AddressSpace);
1462
+ // The maximum index size over all address spaces is a reasonable default
1463
+ // guess for size_t, but it cannot in general by derived by this. Per-target
1464
+ // overrides should be added by reading the Module and/or the Triple to
1465
+ // determine when this default doesn't apply.
1466
+ return M.getDataLayout ().getMaxIndexSizeInBits ();
1472
1467
}
1473
1468
1474
1469
TargetLibraryInfoWrapperPass::TargetLibraryInfoWrapperPass ()
You can’t perform that action at this time.
0 commit comments