allow functions and modules to have an explicit alignment

llvm-svn: 24209
This commit is contained in:
Chris Lattner 2005-11-06 06:44:42 +00:00
parent 86c352b782
commit 6b27e499e5
1 changed files with 7 additions and 0 deletions

View File

@ -42,11 +42,18 @@ protected:
LinkageTypes Linkage; // The linkage of this global
Module *Parent;
unsigned Alignment;
public:
~GlobalValue() {
removeDeadConstantUsers(); // remove any dead constants using this.
}
unsigned getAlignment() const { return Alignment; }
void setAlignment(unsigned Align) {
assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
Alignment = Align;
}
/// If the usage is empty (except transitively dead constants), then this
/// global value can can be safely deleted since the destructor will
/// delete the dead constants as well.