1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Address review feedbacks of AddDiscriminator change

llvm-svn: 272850
This commit is contained in:
Xinliang David Li 2016-06-15 22:20:56 +00:00
parent 61ed9065d4
commit cb0e5a9d47
2 changed files with 7 additions and 6 deletions

View File

@ -20,11 +20,10 @@
namespace llvm {
/// Converts loops into loop-closed SSA form.
class AddDiscriminatorsPass : public PassInfoMixin<AddDiscriminatorsPass> {
public:
PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
};
} // end namespace llvm
#endif // LLVM_TRANSFORMS_UTILS_LCSSA_H
#endif // LLVM_TRANSFORMS_UTILS_ADDDISCRIMINATORS_H

View File

@ -155,7 +155,7 @@ FunctionPass *llvm::createAddDiscriminatorsPass() {
/// 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
/// 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
// discriminators, 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,
AnalysisManager<Function> &AM) {
addDiscriminators(F);
// Only modifies debug info.
return PreservedAnalyses::all();
if (!addDiscriminators(F))
return PreservedAnalyses::all();
// FIXME: should be all()
return PreservedAnalyses::none();
}