diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/Globals.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index 0b49350e551..76baa6202a7 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -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)) |