llvm/tools/llvm-upgrade/UpgradeInternals.h
Reid Spencer 3d6cd1b149 For PR1113:
Increment the counter after the second use, not after the first use. This
fixes PR1113.

Also, rename some classes for simplicity and to more naturally be
reminscient of LLVM 1.9. This in preparation for additional classes that
will provide a scaled down model of the LLVM 1.9 IR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33226 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:40:33 +00:00

66 lines
2.0 KiB
C++

//===-- UpgradeInternals.h - Internal parser definitionsr -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Reid Spencer and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This header file defines the variables that are shared between the lexer,
// the parser, and the main program.
//
//===----------------------------------------------------------------------===//
#ifndef UPGRADE_INTERNALS_H
#define UPGRADE_INTERNALS_H
#include <llvm/ADT/StringExtras.h>
#include <string>
#include <istream>
#include <vector>
#include <set>
#include <cassert>
// Global variables exported from the lexer.
extern std::string CurFileName;
extern std::string Textin;
extern int Upgradelineno;
extern std::istream* LexInput;
// Global variables exported from the parser.
extern char* Upgradetext;
extern int Upgradeleng;
extern unsigned SizeOfPointer;
// Functions exported by the parser
void UpgradeAssembly(
const std::string & infile, std::istream& in, std::ostream &out, bool debug,
bool addAttrs);
int yyerror(const char *ErrorMsg) ;
/// This enum is used to keep track of the original (1.9) type used to form
/// a type. These are needed for type upgrades and to determine how to upgrade
/// signed instructions with signless operands. The Lexer uses thse in its
/// calls to getType
enum TypeIDs {
BoolTy, SByteTy, UByteTy, ShortTy, UShortTy, IntTy, UIntTy, LongTy, ULongTy,
FloatTy, DoubleTy, PointerTy, PackedTy, ArrayTy, StructTy, PackedStructTy,
OpaqueTy, VoidTy, LabelTy, FunctionTy, UnresolvedTy, UpRefTy
};
namespace {
class Type;
class Value;
class Constant;
class Instruction;
}
typedef std::vector<const Type*> TypeList;
typedef std::vector<Value*> ValueList;
/// A function to create a Typeo* used in the Lexer.
extern const Type* getType(const std::string& newTy, TypeIDs oldTy);
#endif