diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-07-02 18:30:05 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-07-02 18:30:05 +0000 |
commit | a8c3509ffe367d002f0f5d25849567a4e125a5c4 (patch) | |
tree | 0de0d697d5c5cde20e712a61353730f4b58b96cf /llvm/lib | |
parent | de58870394099c89187a3b8fde15cb0177b7172d (diff) | |
download | bcm5719-llvm-a8c3509ffe367d002f0f5d25849567a4e125a5c4.tar.gz bcm5719-llvm-a8c3509ffe367d002f0f5d25849567a4e125a5c4.zip |
Constify the Function pointers in the result of makeSubprogramMap
These don't need to be mutable and callers being added soon in CodeGen
won't have access to non-const Module&.
llvm-svn: 212202
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp | 7 |
3 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index c28dc693e77..5e39b242dbb 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -1527,8 +1527,9 @@ unsigned llvm::getDebugMetadataVersionFromModule(const Module &M) { return cast<ConstantInt>(Val)->getZExtValue(); } -llvm::DenseMap<llvm::Function *, llvm::DISubprogram> llvm::makeSubprogramMap(Module &M) { - DenseMap<Function *, DISubprogram> R; +llvm::DenseMap<const llvm::Function *, llvm::DISubprogram> +llvm::makeSubprogramMap(const Module &M) { + DenseMap<const Function *, DISubprogram> R; NamedMDNode *CU_Nodes = M.getNamedMetadata("llvm.dbg.cu"); if (!CU_Nodes) diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index 2e89a252a8e..97a119b01bc 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -84,7 +84,7 @@ namespace { bool doInitialization(CallGraph &CG) override; /// The maximum number of elements to expand, or 0 for unlimited. unsigned maxElements; - DenseMap<Function *, DISubprogram> FunctionDIs; + DenseMap<const Function *, DISubprogram> FunctionDIs; }; } diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp index fa8ef2a3dae..ac3853dbd67 100644 --- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -127,8 +127,7 @@ namespace { // As the code generation for module is finished (and DIBuilder is // finalized) we assume that subprogram descriptors won't be changed, and // they are stored in map for short duration anyway. - typedef DenseMap<Function*, DISubprogram> FunctionDIMap; - FunctionDIMap FunctionDIs; + DenseMap<const Function *, DISubprogram> FunctionDIs; protected: // DAH uses this to specify a different ID. @@ -297,7 +296,7 @@ bool DAE::DeleteDeadVarargs(Function &Fn) { } // Patch the pointer to LLVM function in debug info descriptor. - FunctionDIMap::iterator DI = FunctionDIs.find(&Fn); + auto DI = FunctionDIs.find(&Fn); if (DI != FunctionDIs.end()) DI->second.replaceFunction(NF); @@ -1057,7 +1056,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) { } // Patch the pointer to LLVM function in debug info descriptor. - FunctionDIMap::iterator DI = FunctionDIs.find(F); + auto DI = FunctionDIs.find(F); if (DI != FunctionDIs.end()) DI->second.replaceFunction(NF); |