Mercurial > hg > CbC > CbC_llvm
comparison lib/CodeGen/LexicalScopes.cpp @ 134:3a76565eade5 LLVM5.0.1
update 5.0.1
author | mir3636 |
---|---|
date | Sat, 17 Feb 2018 09:57:20 +0900 |
parents | 803732b1fca8 |
children | c2174574ed3a |
comparison
equal
deleted
inserted
replaced
133:c60214abe0e8 | 134:3a76565eade5 |
---|---|
47 | 47 |
48 /// initialize - Scan machine function and constuct lexical scope nest. | 48 /// initialize - Scan machine function and constuct lexical scope nest. |
49 void LexicalScopes::initialize(const MachineFunction &Fn) { | 49 void LexicalScopes::initialize(const MachineFunction &Fn) { |
50 reset(); | 50 reset(); |
51 // Don't attempt any lexical scope creation for a NoDebug compile unit. | 51 // Don't attempt any lexical scope creation for a NoDebug compile unit. |
52 if (Fn.getFunction()->getSubprogram()->getUnit()->getEmissionKind() == | 52 if (Fn.getFunction().getSubprogram()->getUnit()->getEmissionKind() == |
53 DICompileUnit::NoDebug) | 53 DICompileUnit::NoDebug) |
54 return; | 54 return; |
55 MF = &Fn; | 55 MF = &Fn; |
56 SmallVector<InsnRange, 4> MIRanges; | 56 SmallVector<InsnRange, 4> MIRanges; |
57 DenseMap<const MachineInstr *, LexicalScope *> MI2ScopeMap; | 57 DenseMap<const MachineInstr *, LexicalScope *> MI2ScopeMap; |
171 std::forward_as_tuple(Scope), | 171 std::forward_as_tuple(Scope), |
172 std::forward_as_tuple(Parent, Scope, nullptr, | 172 std::forward_as_tuple(Parent, Scope, nullptr, |
173 false)).first; | 173 false)).first; |
174 | 174 |
175 if (!Parent) { | 175 if (!Parent) { |
176 assert(cast<DISubprogram>(Scope)->describes(MF->getFunction())); | 176 assert(cast<DISubprogram>(Scope)->describes(&MF->getFunction())); |
177 assert(!CurrentFnLexicalScope); | 177 assert(!CurrentFnLexicalScope); |
178 CurrentFnLexicalScope = &I->second; | 178 CurrentFnLexicalScope = &I->second; |
179 } | 179 } |
180 | 180 |
181 return &I->second; | 181 return &I->second; |