Skip to content

Commit e1f91c8

Browse files
Renaming to integerKindForPointer
1 parent 7b81248 commit e1f91c8

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

flang/include/flang/Evaluate/target.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ class TargetCharacteristics {
131131
IeeeFeatures &ieeeFeatures() { return ieeeFeatures_; }
132132
const IeeeFeatures &ieeeFeatures() const { return ieeeFeatures_; }
133133

134-
std::size_t pointerSize() { return pointerSize_; }
135-
void set_pointerSize(std::size_t pointerSize) { pointerSize_ = pointerSize; }
134+
std::size_t integerKindForPointer() { return integerKindForPointer_; }
135+
void set_integerKindForPointer(std::size_t newKind) {
136+
integerKindForPointer_ = newKind;
137+
}
136138

137139
private:
138140
static constexpr int maxKind{common::maxKind};
@@ -159,7 +161,7 @@ class TargetCharacteristics {
159161
IeeeFeature::Io, IeeeFeature::NaN, IeeeFeature::Rounding,
160162
IeeeFeature::Sqrt, IeeeFeature::Standard, IeeeFeature::Subnormal,
161163
IeeeFeature::UnderflowControl};
162-
std::size_t pointerSize_{8 /* bytes */};
164+
std::size_t integerKindForPointer_{8}; /* For 64 bit pointer */
163165
};
164166

165167
} // namespace Fortran::evaluate

flang/include/flang/Tools/TargetSetup.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ namespace Fortran::tools {
9494
if (targetTriple.isOSWindows())
9595
targetCharacteristics.set_isOSWindows(true);
9696

97-
targetCharacteristics.set_pointerSize(
97+
// Currently the integer kind happens to be the same as the byte size
98+
targetCharacteristics.set_integerKindForPointer(
9899
targetTriple.getArchPointerBitWidth() / 8);
99100

100101
// TODO: use target machine data layout to set-up the target characteristics

flang/lib/Semantics/resolve-names.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6690,7 +6690,7 @@ void DeclarationVisitor::Post(const parser::BasedPointer &bp) {
66906690
}
66916691
pointer->set(Symbol::Flag::CrayPointer);
66926692
const DeclTypeSpec &pointerType{MakeNumericType(
6693-
TypeCategory::Integer, context().targetCharacteristics().pointerSize())};
6693+
TypeCategory::Integer, context().targetCharacteristics().integerKindForPointer())};
66946694
const auto *type{pointer->GetType()};
66956695
if (!type) {
66966696
pointer->SetType(pointerType);

0 commit comments

Comments
 (0)