Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/IR/GlobalObject.h
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | public: | ||||
/// Note that for functions this is the alignment of the code, not the | /// Note that for functions this is the alignment of the code, not the | ||||
/// alignment of a function pointer. | /// alignment of a function pointer. | ||||
MaybeAlign getAlign() const { | MaybeAlign getAlign() const { | ||||
unsigned Data = getGlobalValueSubClassData(); | unsigned Data = getGlobalValueSubClassData(); | ||||
unsigned AlignmentData = Data & AlignmentMask; | unsigned AlignmentData = Data & AlignmentMask; | ||||
return decodeMaybeAlign(AlignmentData); | return decodeMaybeAlign(AlignmentData); | ||||
} | } | ||||
/// Sets the alignment attribute of the GlobalObject. | |||||
void setAlignment(Align Align); | |||||
efriedma: Not sure I understand the point of overloading setAlignment; there's an implicit conversion… | |||||
The purpose here is to define a deprecation path for downstream users. gchatelet: The purpose here is to define a deprecation path for downstream users.
Once we've cleaned up… | |||||
/// Sets the alignment attribute of the GlobalObject. | |||||
/// This method will be deprecated as the alignment property should always be | |||||
/// defined. | |||||
Not Done ReplyInline Actionsdefined* courbet: defined* | |||||
void setAlignment(MaybeAlign Align); | void setAlignment(MaybeAlign Align); | ||||
unsigned getGlobalObjectSubClassData() const { | unsigned getGlobalObjectSubClassData() const { | ||||
unsigned ValueData = getGlobalValueSubClassData(); | unsigned ValueData = getGlobalValueSubClassData(); | ||||
return ValueData >> GlobalObjectBits; | return ValueData >> GlobalObjectBits; | ||||
} | } | ||||
void setGlobalObjectSubClassData(unsigned Val) { | void setGlobalObjectSubClassData(unsigned Val) { | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |
Not sure I understand the point of overloading setAlignment; there's an implicit conversion from Align to MaybeAlign.