summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/Module.cpp3
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 3d3dc737a1b..968b8f4b904 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -233,8 +233,7 @@ 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) const {
+GlobalVariable *Module::getGlobalVariable(StringRef Name, bool AllowLocal) {
if (GlobalVariable *Result =
dyn_cast_or_null<GlobalVariable>(getNamedValue(Name)))
if (AllowLocal || !Result->hasLocalLinkage())
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 183a599bc12..6250cc5ec45 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -3043,7 +3043,7 @@ bool GlobalOpt::OptimizeGlobalCtorsList(GlobalVariable *&GCL) {
/// \brief Given "llvm.used" or "llvm.compiler.used" as a global name, collect
/// the initializer elements of that global in Set and return the global itself.
static GlobalVariable *
-collectUsedGlobalVariables(const Module &M, const char *Name,
+collectUsedGlobalVariables(Module &M, const char *Name,
SmallPtrSet<GlobalValue *, 8> &Set) {
GlobalVariable *GV = M.getGlobalVariable(Name);
if (!GV || !GV->hasInitializer())
@@ -3106,7 +3106,7 @@ class LLVMUsed {
GlobalVariable *CompilerUsedV;
public:
- LLVMUsed(const Module &M) {
+ LLVMUsed(Module &M) {
UsedV = collectUsedGlobalVariables(M, "llvm.used", Used);
CompilerUsedV =
collectUsedGlobalVariables(M, "llvm.compiler.used", CompilerUsed);
OpenPOWER on IntegriCloud