summaryrefslogtreecommitdiff
path: root/lib/Bytecode/Analyzer/AnalyzerInternals.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bytecode/Analyzer/AnalyzerInternals.h')
-rw-r--r--lib/Bytecode/Analyzer/AnalyzerInternals.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/lib/Bytecode/Analyzer/AnalyzerInternals.h b/lib/Bytecode/Analyzer/AnalyzerInternals.h
new file mode 100644
index 0000000000..d9a2e843d8
--- /dev/null
+++ b/lib/Bytecode/Analyzer/AnalyzerInternals.h
@@ -0,0 +1,65 @@
+//===-- ReaderInternals.h - Definitions internal to the reader --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This header file defines various stuff that is used by the bytecode reader.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef ANALYZER_INTERNALS_H
+#define ANALYZER_INTERNALS_H
+
+#include "Parser.h"
+#include "llvm/Bytecode/Analyzer.h"
+
+// Enable to trace to figure out what the heck is going on when parsing fails
+//#define TRACE_LEVEL 10
+//#define DEBUG_OUTPUT
+
+#if TRACE_LEVEL // ByteCodeReading_TRACEr
+#define BCR_TRACE(n, X) \
+ if (n < TRACE_LEVEL) std::cerr << std::string(n*2, ' ') << X
+#else
+#define BCR_TRACE(n, X)
+#endif
+
+namespace llvm {
+
+class BytecodeAnalyzer {
+ BytecodeAnalyzer(const BytecodeAnalyzer &); // DO NOT IMPLEMENT
+ void operator=(const BytecodeAnalyzer &); // DO NOT IMPLEMENT
+public:
+ BytecodeAnalyzer() { }
+ ~BytecodeAnalyzer() { }
+
+ void AnalyzeBytecode(
+ const unsigned char *Buf,
+ unsigned Length,
+ BytecodeAnalysis& bca,
+ const std::string &ModuleID
+ );
+
+ void DumpBytecode(
+ const unsigned char *Buf,
+ unsigned Length,
+ BytecodeAnalysis& bca,
+ const std::string &ModuleID
+ );
+
+ void dump() const {
+ std::cerr << "BytecodeParser instance!\n";
+ }
+private:
+ BytecodeAnalysis TheAnalysis;
+};
+
+} // End llvm namespace
+
+#endif
+
+// vim: sw=2