Mercurial > hg > CbC > CbC_llvm
comparison llvm/lib/IR/Pass.cpp @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 0572611fdcc8 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
60 OptPassGate &Gate = M.getContext().getOptPassGate(); | 60 OptPassGate &Gate = M.getContext().getOptPassGate(); |
61 return Gate.isEnabled() && !Gate.shouldRunPass(this, getDescription(M)); | 61 return Gate.isEnabled() && !Gate.shouldRunPass(this, getDescription(M)); |
62 } | 62 } |
63 | 63 |
64 bool Pass::mustPreserveAnalysisID(char &AID) const { | 64 bool Pass::mustPreserveAnalysisID(char &AID) const { |
65 return Resolver->getAnalysisIfAvailable(&AID, true) != nullptr; | 65 return Resolver->getAnalysisIfAvailable(&AID) != nullptr; |
66 } | 66 } |
67 | 67 |
68 // dumpPassStructure - Implement the -debug-pass=Structure option | 68 // dumpPassStructure - Implement the -debug-pass=Structure option |
69 void Pass::dumpPassStructure(unsigned Offset) { | 69 void Pass::dumpPassStructure(unsigned Offset) { |
70 dbgs().indent(Offset*2) << getPassName() << "\n"; | 70 dbgs().indent(Offset*2) << getPassName() << "\n"; |
257 } | 257 } |
258 | 258 |
259 AnalysisUsage &AnalysisUsage::addPreserved(StringRef Arg) { | 259 AnalysisUsage &AnalysisUsage::addPreserved(StringRef Arg) { |
260 const PassInfo *PI = Pass::lookupPassInfo(Arg); | 260 const PassInfo *PI = Pass::lookupPassInfo(Arg); |
261 // If the pass exists, preserve it. Otherwise silently do nothing. | 261 // If the pass exists, preserve it. Otherwise silently do nothing. |
262 if (PI) Preserved.push_back(PI->getTypeInfo()); | 262 if (PI) |
263 pushUnique(Preserved, PI->getTypeInfo()); | |
263 return *this; | 264 return *this; |
264 } | 265 } |
265 | 266 |
266 AnalysisUsage &AnalysisUsage::addRequiredID(const void *ID) { | 267 AnalysisUsage &AnalysisUsage::addRequiredID(const void *ID) { |
267 Required.push_back(ID); | 268 pushUnique(Required, ID); |
268 return *this; | 269 return *this; |
269 } | 270 } |
270 | 271 |
271 AnalysisUsage &AnalysisUsage::addRequiredID(char &ID) { | 272 AnalysisUsage &AnalysisUsage::addRequiredID(char &ID) { |
272 Required.push_back(&ID); | 273 pushUnique(Required, &ID); |
273 return *this; | 274 return *this; |
274 } | 275 } |
275 | 276 |
276 AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(char &ID) { | 277 AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(char &ID) { |
277 Required.push_back(&ID); | 278 pushUnique(Required, &ID); |
278 RequiredTransitive.push_back(&ID); | 279 pushUnique(RequiredTransitive, &ID); |
279 return *this; | 280 return *this; |
280 } | 281 } |