Be more strict about not allowing setSection on aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208095 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-05-06 14:59:14 +00:00
parent 55ba6a126f
commit 4f1723522e
2 changed files with 6 additions and 5 deletions

View File

@@ -73,6 +73,11 @@ void GlobalValue::setAlignment(unsigned Align) {
assert(getAlignment() == Align && "Alignment representation error!");
}
void GlobalValue::setSection(StringRef S) {
assert(!isa<GlobalAlias>(this) && "GlobalAlias should not have a section!");
Section = S;
}
bool GlobalValue::isDeclaration() const {
// Globals are definitions if they have an initializer.
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(this))