[llvm] r272850 - Address review feedbacks of AddDiscriminator change
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 15 15:20:57 PDT 2016
Author: davidxl
Date: Wed Jun 15 17:20:56 2016
New Revision: 272850
URL: http://llvm.org/viewvc/llvm-project?rev=272850&view=rev
Log:
Address review feedbacks of AddDiscriminator change
Modified:
llvm/trunk/include/llvm/Transforms/Utils/AddDiscriminators.h
llvm/trunk/lib/Transforms/Utils/AddDiscriminators.cpp
Modified: llvm/trunk/include/llvm/Transforms/Utils/AddDiscriminators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/AddDiscriminators.h?rev=272850&r1=272849&r2=272850&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/AddDiscriminators.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/AddDiscriminators.h Wed Jun 15 17:20:56 2016
@@ -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
Modified: llvm/trunk/lib/Transforms/Utils/AddDiscriminators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/AddDiscriminators.cpp?rev=272850&r1=272849&r2=272850&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/AddDiscriminators.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/AddDiscriminators.cpp Wed Jun 15 17:20:56 2016
@@ -155,7 +155,7 @@ FunctionPass *llvm::createAddDiscriminat
/// 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::runOnF
}
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();
}
More information about the llvm-commits
mailing list