mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-27 21:50:40 +00:00
Address review feedbacks of AddDiscriminator change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272850 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1e8c62127b
commit
ac1a58e7e9
@ -20,11 +20,10 @@
|
|||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
/// Converts loops into loop-closed SSA form.
|
|
||||||
class AddDiscriminatorsPass : public PassInfoMixin<AddDiscriminatorsPass> {
|
class AddDiscriminatorsPass : public PassInfoMixin<AddDiscriminatorsPass> {
|
||||||
public:
|
public:
|
||||||
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
|
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
|
||||||
};
|
};
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
||||||
#endif // LLVM_TRANSFORMS_UTILS_LCSSA_H
|
#endif // LLVM_TRANSFORMS_UTILS_ADDDISCRIMINATORS_H
|
||||||
|
@ -155,7 +155,7 @@ FunctionPass *llvm::createAddDiscriminatorsPass() {
|
|||||||
/// lexical block for I2 and all the instruction in B2 that share the same
|
/// lexical block for I2 and all the instruction in B2 that share the same
|
||||||
/// file and line location as I2. This new lexical block will have a
|
/// file and line location as I2. This new lexical block will have a
|
||||||
/// different discriminator number than I1.
|
/// different discriminator number than I1.
|
||||||
bool addDiscriminators(Function &F) {
|
static bool addDiscriminators(Function &F) {
|
||||||
// If the function has debug information, but the user has disabled
|
// If the function has debug information, but the user has disabled
|
||||||
// discriminators, do nothing.
|
// discriminators, do nothing.
|
||||||
// Simlarly, if the function has no debug info, do nothing.
|
// Simlarly, if the function has no debug info, do nothing.
|
||||||
@ -250,7 +250,9 @@ bool AddDiscriminatorsLegacyPass::runOnFunction(Function &F) {
|
|||||||
}
|
}
|
||||||
PreservedAnalyses AddDiscriminatorsPass::run(Function &F,
|
PreservedAnalyses AddDiscriminatorsPass::run(Function &F,
|
||||||
AnalysisManager<Function> &AM) {
|
AnalysisManager<Function> &AM) {
|
||||||
addDiscriminators(F);
|
if (!addDiscriminators(F))
|
||||||
// Only modifies debug info.
|
return PreservedAnalyses::all();
|
||||||
return PreservedAnalyses::all();
|
|
||||||
|
// FIXME: should be all()
|
||||||
|
return PreservedAnalyses::none();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user