diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-03-27 05:47:03 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-03-27 05:47:03 +0000 |
commit | 1dd20e654421bfd65e9bfe59f833c7e1a2312350 (patch) | |
tree | 45f861b974eb6723133930f943519b680b920ecc /llvm/lib/IR/Module.cpp | |
parent | 1c78f4a0ff6811e9c3d8fe4a827358b9c01dab61 (diff) | |
download | bcm5719-llvm-1dd20e654421bfd65e9bfe59f833c7e1a2312350.tar.gz bcm5719-llvm-1dd20e654421bfd65e9bfe59f833c7e1a2312350.zip |
[IR] Implement pairs of non-const and const methods using the const version instead of the non-const version. NFCI
This removes a const_cast of the this pointer.
llvm-svn: 298831
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r-- | llvm/lib/IR/Module.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index 9297e5b4393..c3bfee5cb68 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -206,7 +206,8 @@ Function *Module::getFunction(StringRef Name) const { /// If AllowLocal is set to true, this function will return types that /// have an local. By default, these types are not returned. /// -GlobalVariable *Module::getGlobalVariable(StringRef Name, bool AllowLocal) { +GlobalVariable *Module::getGlobalVariable(StringRef Name, + bool AllowLocal) const { if (GlobalVariable *Result = dyn_cast_or_null<GlobalVariable>(getNamedValue(Name))) if (AllowLocal || !Result->hasLocalLinkage()) |