aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/JSBackend/SimplifyAllocas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/JSBackend/SimplifyAllocas.cpp')
-rw-r--r--lib/Target/JSBackend/SimplifyAllocas.cpp29
1 files changed, 11 insertions, 18 deletions
diff --git a/lib/Target/JSBackend/SimplifyAllocas.cpp b/lib/Target/JSBackend/SimplifyAllocas.cpp
index 858ded32a1..a6c090e7e4 100644
--- a/lib/Target/JSBackend/SimplifyAllocas.cpp
+++ b/lib/Target/JSBackend/SimplifyAllocas.cpp
@@ -1,4 +1,4 @@
-//===-- SimplifyAllocas.cpp - TargetMachine for the C++ backend --*- C++ -*-===//
+//===-- SimplifyAllocas.cpp - Alloca optimization ---------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -6,29 +6,23 @@
// License. See LICENSE.TXT for details.
//
//===-----------------------------------------------------------------------===//
+//
+// There shouldn't be any opportunities for this pass to do anything if the
+// regular LLVM optimizer passes are run. However, it does make things nicer
+// at -O0.
+//
+//===-----------------------------------------------------------------------===//
-#include <OptPasses.h>
+#include "OptPasses.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Function.h"
-// XXX
-#include "llvm/Support/FormattedStream.h"
-#include <stdio.h>
-#define dump(x) fprintf(stderr, x "\n")
-#define dumpv(x, ...) fprintf(stderr, x "\n", __VA_ARGS__)
-#define dumpfail(x) { fprintf(stderr, x "\n"); fprintf(stderr, "%s : %d\n", __FILE__, __LINE__); report_fatal_error("fail"); }
-#define dumpfailv(x, ...) { fprintf(stderr, x "\n", __VA_ARGS__); fprintf(stderr, "%s : %d\n", __FILE__, __LINE__); report_fatal_error("fail"); }
-#define dumpIR(value) { \
- std::string temp; \
- raw_string_ostream stream(temp); \
- stream << *(value); \
- fprintf(stderr, "%s\n", temp.c_str()); \
-}
+#ifdef NDEBUG
#undef assert
-#define assert(x) { if (!(x)) dumpfail(#x); }
-// XXX
+#define assert(x) { if (!(x)) report_fatal_error(#x); }
+#endif
namespace llvm {
@@ -115,4 +109,3 @@ extern FunctionPass *createSimplifyAllocasPass() {
}
} // End llvm namespace
-