[llvm-commits] CVS: llvm/lib/Support/SlowOperationInformer.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Jul 6 15:34:20 PDT 2006
Changes in directory llvm/lib/Support:
SlowOperationInformer.cpp updated: 1.7 -> 1.8
---
Log message:
Modify the SlowOperationInformer interface to not throw exceptions.
---
Diffs of the changes: (+4 -3)
SlowOperationInformer.cpp | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
Index: llvm/lib/Support/SlowOperationInformer.cpp
diff -u llvm/lib/Support/SlowOperationInformer.cpp:1.7 llvm/lib/Support/SlowOperationInformer.cpp:1.8
--- llvm/lib/Support/SlowOperationInformer.cpp:1.7 Wed Dec 21 21:31:26 2005
+++ llvm/lib/Support/SlowOperationInformer.cpp Thu Jul 6 17:34:06 2006
@@ -37,18 +37,18 @@
/// an exception-safe state. The Amount variable should indicate how far
/// along the operation is, given in 1/10ths of a percent (in other words,
/// Amount should range from 0 to 1000).
-void SlowOperationInformer::progress(unsigned Amount) {
+bool SlowOperationInformer::progress(unsigned Amount) {
int status = sys::AlarmStatus();
if (status == -1) {
std::cout << "\n";
LastPrintAmount = 0;
- throw "While " + OperationName + ", operation cancelled.";
+ return true;
}
// If we haven't spent enough time in this operation to warrant displaying the
// progress bar, don't do so yet.
if (status == 0)
- return;
+ return false;
// Delete whatever we printed last time.
std::string ToPrint = std::string(LastPrintAmount, '\b');
@@ -62,4 +62,5 @@
LastPrintAmount = OS.str().size();
std::cout << ToPrint+OS.str() << std::flush;
+ return false;
}
More information about the llvm-commits
mailing list