Expose passinfo from BreakCriticalEdges pass so that it may be "Required" by
[oota-llvm.git] / include / llvm / Assembly / Parser.h
1 //===-- llvm/Assembly/Parser.h - Parser for VM assembly files ----*- C++ -*--=//
2 //
3 //  These classes are implemented by the lib/AsmParser library.
4 //
5 //===----------------------------------------------------------------------===//
6
7 #ifndef LLVM_ASSEMBLY_PARSER_H
8 #define LLVM_ASSEMBLY_PARSER_H
9
10 #include <string>
11
12 class Module;
13 class ParseException;
14
15
16 // The useful interface defined by this file... Parse an ascii file, and return
17 // the internal representation in a nice slice'n'dice'able representation.  Note
18 // that this does not verify that the generated LLVM is valid, so you should run
19 // the verifier after parsing the file to check that it's ok.
20 //
21 Module *ParseAssemblyFile(const std::string &Filename);// throw (ParseException)
22
23 //===------------------------------------------------------------------------===
24 //                              Helper Classes
25 //===------------------------------------------------------------------------===
26
27 // ParseException - For when an exceptional event is generated by the parser.
28 // This class lets you print out the exception message
29 //
30 class ParseException {
31 public:
32   ParseException(const std::string &filename, const std::string &message, 
33                  int LineNo = -1, int ColNo = -1);
34
35   ParseException(const ParseException &E);
36
37   // getMessage - Return the message passed in at construction time plus extra 
38   // information extracted from the options used to parse with...
39   //
40   const std::string getMessage() const;
41
42   inline const std::string &getRawMessage() const {   // Just the raw message...
43     return Message;
44   }
45
46   inline const std::string &getFilename() const {
47     return Filename;
48   }
49
50   // getErrorLocation - Return the line and column number of the error in the
51   // input source file.  The source filename can be derived from the 
52   // ParserOptions in effect.  If positional information is not applicable, 
53   // these will return a value of -1.
54   //
55   inline const void getErrorLocation(int &Line, int &Column) const {
56     Line = LineNo; Column = ColumnNo;
57   }
58
59 private :
60   std::string Filename;
61   std::string Message;
62   int LineNo, ColumnNo;                               // -1 if not relevant
63
64   ParseException &operator=(const ParseException &E); // objects by reference
65 };
66
67 #endif