summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Globals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Globals.cpp')
-rw-r--r--llvm/lib/IR/Globals.cpp5
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))
OpenPOWER on IntegriCloud