diff options
Diffstat (limited to 'include/llvm/IR/GlobalValue.h')
-rw-r--r-- | include/llvm/IR/GlobalValue.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/llvm/IR/GlobalValue.h b/include/llvm/IR/GlobalValue.h index c6398aaa4847f..bb30fa8be8674 100644 --- a/include/llvm/IR/GlobalValue.h +++ b/include/llvm/IR/GlobalValue.h @@ -211,9 +211,10 @@ public: } bool hasComdat() const { return getComdat() != nullptr; } - Comdat *getComdat(); - const Comdat *getComdat() const { - return const_cast<GlobalValue *>(this)->getComdat(); + const Comdat *getComdat() const; + Comdat *getComdat() { + return const_cast<Comdat *>( + static_cast<const GlobalValue *>(this)->getComdat()); } VisibilityTypes getVisibility() const { return VisibilityTypes(Visibility); } @@ -514,10 +515,11 @@ public: // increased. bool canIncreaseAlignment() const; - const GlobalObject *getBaseObject() const { - return const_cast<GlobalValue *>(this)->getBaseObject(); + const GlobalObject *getBaseObject() const; + GlobalObject *getBaseObject() { + return const_cast<GlobalObject *>( + static_cast<const GlobalValue *>(this)->getBaseObject()); } - GlobalObject *getBaseObject(); /// Returns whether this is a reference to an absolute symbol. bool isAbsoluteSymbolRef() const; |