1 //===-- UpgradeInternals.h - Internal parser definitionsr -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Reid Spencer and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header file defines the variables that are shared between the lexer,
11 // the parser, and the main program.
13 //===----------------------------------------------------------------------===//
15 #ifndef UPGRADE_INTERNALS_H
16 #define UPGRADE_INTERNALS_H
18 #include <llvm/ADT/StringExtras.h>
25 // Global variables exported from the lexer.
26 extern std::string CurFileName;
27 extern std::string Textin;
28 extern int Upgradelineno;
29 extern std::istream* LexInput;
31 // Global variables exported from the parser.
32 extern char* Upgradetext;
33 extern int Upgradeleng;
34 extern unsigned SizeOfPointer;
36 // Functions exported by the parser
38 const std::string & infile, std::istream& in, std::ostream &out, bool debug,
40 int yyerror(const char *ErrorMsg) ;
42 /// This enum is used to keep track of the original (1.9) type used to form
43 /// a type. These are needed for type upgrades and to determine how to upgrade
44 /// signed instructions with signless operands. The Lexer uses thse in its
47 BoolTy, SByteTy, UByteTy, ShortTy, UShortTy, IntTy, UIntTy, LongTy, ULongTy,
48 FloatTy, DoubleTy, PointerTy, PackedTy, ArrayTy, StructTy, PackedStructTy,
49 OpaqueTy, VoidTy, LabelTy, FunctionTy, UnresolvedTy, UpRefTy
59 typedef std::vector<const Type*> TypeList;
60 typedef std::vector<Value*> ValueList;
62 /// A function to create a Typeo* used in the Lexer.
63 extern const Type* getType(const std::string& newTy, TypeIDs oldTy);