mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
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&. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212202 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9b4509a759
commit
8446d2db2a
@ -935,7 +935,7 @@ private:
|
||||
bool TypeMapInitialized;
|
||||
};
|
||||
|
||||
DenseMap<Function *, DISubprogram> makeSubprogramMap(Module &M);
|
||||
DenseMap<const Function *, DISubprogram> makeSubprogramMap(const Module &M);
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user