LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvmAsmParser.cpp File Reference

#include "ParserInternals.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
#include "llvm/SymbolTable.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/ADT/STLExtras.h"
#include <algorithm>
#include <iostream>
#include <list>
#include <utility>

Include dependency graph for llvmAsmParser.cpp:

Go to the source code of this file.

Namespaces

namespace  llvm

Classes

struct  PerModuleInfo
struct  PerFunctionInfo
union  YYSTYPE
union  yyalloc

Defines

#define YYBISON   1
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   0
#define YYLSP_NEEDED   0
#define yyparse   llvmAsmparse
#define yylex   llvmAsmlex
#define yyerror   llvmAsmerror
#define yylval   llvmAsmlval
#define yychar   llvmAsmchar
#define yydebug   llvmAsmdebug
#define yynerrs   llvmAsmnerrs
#define ESINT64VAL   258
#define EUINT64VAL   259
#define SINTVAL   260
#define UINTVAL   261
#define FPVAL   262
#define VOID   263
#define BOOL   264
#define SBYTE   265
#define UBYTE   266
#define SHORT   267
#define USHORT   268
#define INT   269
#define UINT   270
#define LONG   271
#define ULONG   272
#define FLOAT   273
#define DOUBLE   274
#define TYPE   275
#define LABEL   276
#define VAR_ID   277
#define LABELSTR   278
#define STRINGCONSTANT   279
#define IMPLEMENTATION   280
#define ZEROINITIALIZER   281
#define TRUETOK   282
#define FALSETOK   283
#define BEGINTOK   284
#define ENDTOK   285
#define DECLARE   286
#define GLOBAL   287
#define CONSTANT   288
#define VOLATILE   289
#define TO   290
#define DOTDOTDOT   291
#define NULL_TOK   292
#define UNDEF   293
#define CONST   294
#define INTERNAL   295
#define LINKONCE   296
#define WEAK   297
#define APPENDING   298
#define OPAQUE   299
#define NOT   300
#define EXTERNAL   301
#define TARGET   302
#define TRIPLE   303
#define ENDIAN   304
#define POINTERSIZE   305
#define LITTLE   306
#define BIG   307
#define DEPLIBS   308
#define RET   309
#define BR   310
#define SWITCH   311
#define INVOKE   312
#define UNWIND   313
#define UNREACHABLE   314
#define ADD   315
#define SUB   316
#define MUL   317
#define DIV   318
#define REM   319
#define AND   320
#define OR   321
#define XOR   322
#define SETLE   323
#define SETGE   324
#define SETLT   325
#define SETGT   326
#define SETEQ   327
#define SETNE   328
#define MALLOC   329
#define ALLOCA   330
#define FREE   331
#define LOAD   332
#define STORE   333
#define GETELEMENTPTR   334
#define PHI_TOK   335
#define CALL   336
#define CAST   337
#define SELECT   338
#define SHL   339
#define SHR   340
#define VAARG   341
#define VANEXT   342
#define VA_ARG   343
#define UR_OUT(X)
#define YYERROR_VERBOSE   1
#define YYDEBUG   0
#define YYERROR_VERBOSE   1
#define yystype   YYSTYPE
#define YYSTYPE_IS_DECLARED   1
#define YYSTYPE_IS_TRIVIAL   1
#define YYFREE   free
#define YYMALLOC   malloc
#define YYSTACK_ALLOC   YYMALLOC
#define YYSTACK_FREE   YYFREE
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY(To, From, Count)
#define YYSTACK_RELOCATE(Stack)
#define YYFINAL   4
#define YYLAST   1211
#define YYNTOKENS   103
#define YYNNTS   60
#define YYNRULES   205
#define YYNSTATES   408
#define YYUNDEFTOK   2
#define YYMAXUTOK   343
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYPACT_NINF   -366
#define YYTABLE_NINF   -103
#define YYSIZE_T   unsigned int
#define yyerrok   (yyerrstatus = 0)
#define yyclearin   (yychar = YYEMPTY)
#define YYEMPTY   (-2)
#define YYEOF   0
#define YYACCEPT   goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR   goto yyerrorlab
#define YYFAIL   goto yyerrlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYRHSLOC(Rhs, K)   ((Rhs)[K])
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YY_LOCATION_PRINT(File, Loc)   ((void) 0)
#define YYLEX   yylex ()
#define YYDPRINTF(Args)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_REDUCE_PRINT(Rule)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPOPSTACK   (yyvsp--, yyssp--)

Typedefs

typedef std::vector< Value * > ValueList
typedef YYSTYPE YYSTYPE
typedef short int yysigned_char

Enumerations

enum  yytokentype {
  ESINT64VAL = 258, EUINT64VAL = 259, SINTVAL = 260, UINTVAL = 261,
  FPVAL = 262, VOID = 263, BOOL = 264, SBYTE = 265,
  UBYTE = 266, SHORT = 267, USHORT = 268, INT = 269,
  UINT = 270, LONG = 271, ULONG = 272, FLOAT = 273,
  DOUBLE = 274, TYPE = 275, LABEL = 276, VAR_ID = 277,
  LABELSTR = 278, STRINGCONSTANT = 279, IMPLEMENTATION = 280, ZEROINITIALIZER = 281,
  TRUETOK = 282, FALSETOK = 283, BEGINTOK = 284, ENDTOK = 285,
  DECLARE = 286, GLOBAL = 287, CONSTANT = 288, VOLATILE = 289,
  TO = 290, DOTDOTDOT = 291, NULL_TOK = 292, UNDEF = 293,
  CONST = 294, INTERNAL = 295, LINKONCE = 296, WEAK = 297,
  APPENDING = 298, OPAQUE = 299, NOT = 300, EXTERNAL = 301,
  TARGET = 302, TRIPLE = 303, ENDIAN = 304, POINTERSIZE = 305,
  LITTLE = 306, BIG = 307, DEPLIBS = 308, RET = 309,
  BR = 310, SWITCH = 311, INVOKE = 312, UNWIND = 313,
  UNREACHABLE = 314, ADD = 315, SUB = 316, MUL = 317,
  DIV = 318, REM = 319, AND = 320, OR = 321,
  XOR = 322, SETLE = 323, SETGE = 324, SETLT = 325,
  SETGT = 326, SETEQ = 327, SETNE = 328, MALLOC = 329,
  ALLOCA = 330, FREE = 331, LOAD = 332, STORE = 333,
  GETELEMENTPTR = 334, PHI_TOK = 335, CALL = 336, CAST = 337,
  SELECT = 338, SHL = 339, SHR = 340, VAARG = 341,
  VANEXT = 342, VA_ARG = 343
}

Functions

int yyerror (const char *ErrorMsg)
int yylex ()
int yyparse ()
static void ResolveDefinitions (std::map< const Type *, ValueList > &LateResolvers, std::map< const Type *, ValueList > *FutureLateResolvers=0)
static bool inFunctionScope ()
static int InsertValue (Value *V, std::map< const Type *, ValueList > &ValueTab=CurFun.Values)
static const TypegetTypeVal (const ValID &D, bool DoNotImprovise=false)
static ValuelookupInSymbolTable (const Type *Ty, const std::string &Name)
static ValuegetValNonImprovising (const Type *Ty, const ValID &D)
static ValuegetVal (const Type *Ty, const ValID &ID)
static BasicBlockgetBBVal (const ValID &ID, bool isDefinition=false)
static void ResolveTypeTo (char *Name, const Type *ToTy)
static void ResolveTypes (std::map< ValID, PATypeHolder > &LateResolveTypes)
static void setValueName (Value *V, char *NameStr)
static void ParseGlobalVariable (char *NameStr, GlobalValue::LinkageTypes Linkage, bool isConstantGlobal, const Type *Ty, Constant *Initializer)
static bool setTypeName (const Type *T, char *NameStr)
static bool TypeContains (const Type *Ty, const Type *E)
static PATypeHolder HandleUpRefs (const Type *ty)
Modulellvm::RunVMAsmParser (const std::string &Filename, FILE *F)
static YYSIZE_T yystrlen (yystr) const char *yystr

Variables

std::string llvm::CurFilename
static ModuleParserResult
static BasicBlockCurBB
static bool ObsoleteVarArgs
static struct PerModuleInfo CurModule
static struct PerFunctionInfo CurFun
static std::vector< UpRefRecord > UpRefs
static const unsigned char yytranslate []
static const char *const yytname []
static const unsigned char yyr1 []
static const unsigned char yyr2 []
static const unsigned char yydefact []
static const short int yydefgoto []
static const short int yypact []
static const short int yypgoto []
static const short int yytable []
static const short int yycheck []
static const unsigned char yystos []
const char * yysrc
int yytype
YYSTYPEyyvaluep
int yychar
YYSTYPE yylval
int yynerrs


Define Documentation

#define ADD   315
 

Definition at line 209 of file llvmAsmParser.cpp.

Referenced by llvm::PPC32RegisterInfo::PPC32RegisterInfo(), and llvm::PPC64RegisterInfo::PPC64RegisterInfo().

#define ALLOCA   330
 

Definition at line 224 of file llvmAsmParser.cpp.

#define AND   320
 

Definition at line 214 of file llvmAsmParser.cpp.

#define APPENDING   298
 

Definition at line 192 of file llvmAsmParser.cpp.

#define BEGINTOK   284
 

Definition at line 178 of file llvmAsmParser.cpp.

#define BIG   307
 

Definition at line 201 of file llvmAsmParser.cpp.

#define BOOL   264
 

Definition at line 158 of file llvmAsmParser.cpp.

#define BR   310
 

Definition at line 204 of file llvmAsmParser.cpp.

#define CALL   336
 

Definition at line 230 of file llvmAsmParser.cpp.

#define CAST   337
 

Definition at line 231 of file llvmAsmParser.cpp.

#define CONST   294
 

Definition at line 188 of file llvmAsmParser.cpp.

#define CONSTANT   288
 

Definition at line 182 of file llvmAsmParser.cpp.

#define DECLARE   286
 

Definition at line 180 of file llvmAsmParser.cpp.

#define DEPLIBS   308
 

Definition at line 202 of file llvmAsmParser.cpp.

#define DIV   318
 

Definition at line 212 of file llvmAsmParser.cpp.

#define DOTDOTDOT   291
 

Definition at line 185 of file llvmAsmParser.cpp.

#define DOUBLE   274
 

Definition at line 168 of file llvmAsmParser.cpp.

#define ENDIAN   304
 

Definition at line 198 of file llvmAsmParser.cpp.

#define ENDTOK   285
 

Definition at line 179 of file llvmAsmParser.cpp.

#define ESINT64VAL   258
 

Definition at line 152 of file llvmAsmParser.cpp.

#define EUINT64VAL   259
 

Definition at line 153 of file llvmAsmParser.cpp.

#define EXTERNAL   301
 

Definition at line 195 of file llvmAsmParser.cpp.

#define FALSETOK   283
 

Definition at line 177 of file llvmAsmParser.cpp.

#define FLOAT   273
 

Definition at line 167 of file llvmAsmParser.cpp.

#define FPVAL   262
 

Definition at line 156 of file llvmAsmParser.cpp.

#define FREE   331
 

Definition at line 225 of file llvmAsmParser.cpp.

#define GETELEMENTPTR   334
 

Definition at line 228 of file llvmAsmParser.cpp.

#define GLOBAL   287
 

Definition at line 181 of file llvmAsmParser.cpp.

#define IMPLEMENTATION   280
 

Definition at line 174 of file llvmAsmParser.cpp.

#define INT   269
 

Definition at line 163 of file llvmAsmParser.cpp.

#define INTERNAL   295
 

Definition at line 189 of file llvmAsmParser.cpp.

#define INVOKE   312
 

Definition at line 206 of file llvmAsmParser.cpp.

#define LABEL   276
 

Definition at line 170 of file llvmAsmParser.cpp.

#define LABELSTR   278
 

Definition at line 172 of file llvmAsmParser.cpp.

#define LINKONCE   296
 

Definition at line 190 of file llvmAsmParser.cpp.

#define LITTLE   306
 

Definition at line 200 of file llvmAsmParser.cpp.

#define LOAD   332
 

Definition at line 226 of file llvmAsmParser.cpp.

#define LONG   271
 

Definition at line 165 of file llvmAsmParser.cpp.

#define MALLOC   329
 

Definition at line 223 of file llvmAsmParser.cpp.

#define MUL   317
 

Definition at line 211 of file llvmAsmParser.cpp.

#define NOT   300
 

Definition at line 194 of file llvmAsmParser.cpp.

#define NULL_TOK   292
 

Definition at line 186 of file llvmAsmParser.cpp.

#define OPAQUE   299
 

Definition at line 193 of file llvmAsmParser.cpp.

#define OR   321
 

Definition at line 215 of file llvmAsmParser.cpp.

Referenced by llvm::PPC64RegisterInfo::copyRegToReg(), llvm::PPC32RegisterInfo::copyRegToReg(), llvm::PPC64RegisterInfo::emitEpilogue(), llvm::PPC32RegisterInfo::emitEpilogue(), llvm::PPC64RegisterInfo::emitPrologue(), llvm::PPC32RegisterInfo::emitPrologue(), llvm::PPC64InstrInfo::isMoveInstr(), and llvm::PPC32InstrInfo::isMoveInstr().

#define PHI_TOK   335
 

Definition at line 229 of file llvmAsmParser.cpp.

#define POINTERSIZE   305
 

Definition at line 199 of file llvmAsmParser.cpp.

#define REM   319
 

Definition at line 213 of file llvmAsmParser.cpp.

#define RET   309
 

Definition at line 203 of file llvmAsmParser.cpp.

Referenced by llvm::X86RegisterInfo::emitEpilogue().

#define SBYTE   265
 

Definition at line 159 of file llvmAsmParser.cpp.

#define SELECT   338
 

Definition at line 232 of file llvmAsmParser.cpp.

#define SETEQ   327
 

Definition at line 221 of file llvmAsmParser.cpp.

#define SETGE   324
 

Definition at line 218 of file llvmAsmParser.cpp.

#define SETGT   326
 

Definition at line 220 of file llvmAsmParser.cpp.

#define SETLE   323
 

Definition at line 217 of file llvmAsmParser.cpp.

#define SETLT   325
 

Definition at line 219 of file llvmAsmParser.cpp.

#define SETNE   328
 

Definition at line 222 of file llvmAsmParser.cpp.

#define SHL   339
 

Definition at line 233 of file llvmAsmParser.cpp.

#define SHORT   267
 

Definition at line 161 of file llvmAsmParser.cpp.

#define SHR   340
 

Definition at line 234 of file llvmAsmParser.cpp.

#define SINTVAL   260
 

Definition at line 154 of file llvmAsmParser.cpp.

#define STORE   333
 

Definition at line 227 of file llvmAsmParser.cpp.

#define STRINGCONSTANT   279
 

Definition at line 173 of file llvmAsmParser.cpp.

#define SUB   316
 

Definition at line 210 of file llvmAsmParser.cpp.

#define SWITCH   311
 

Definition at line 205 of file llvmAsmParser.cpp.

#define TARGET   302
 

Definition at line 196 of file llvmAsmParser.cpp.

#define TO   290
 

Definition at line 184 of file llvmAsmParser.cpp.

#define TRIPLE   303
 

Definition at line 197 of file llvmAsmParser.cpp.

#define TRUETOK   282
 

Definition at line 176 of file llvmAsmParser.cpp.

#define TYPE   275
 

Definition at line 169 of file llvmAsmParser.cpp.

#define UBYTE   266
 

Definition at line 160 of file llvmAsmParser.cpp.

#define UINT   270
 

Definition at line 164 of file llvmAsmParser.cpp.

#define UINTVAL   261
 

Definition at line 155 of file llvmAsmParser.cpp.

#define ULONG   272
 

Definition at line 166 of file llvmAsmParser.cpp.

#define UNDEF   293
 

Definition at line 187 of file llvmAsmParser.cpp.

#define UNREACHABLE   314
 

Definition at line 208 of file llvmAsmParser.cpp.

#define UNWIND   313
 

Definition at line 207 of file llvmAsmParser.cpp.

#define UR_OUT  ) 
 

Definition at line 274 of file llvmAsmParser.cpp.

Referenced by HandleUpRefs().

#define USHORT   268
 

Definition at line 162 of file llvmAsmParser.cpp.

#define VA_ARG   343
 

Definition at line 237 of file llvmAsmParser.cpp.

#define VAARG   341
 

Definition at line 235 of file llvmAsmParser.cpp.

#define VANEXT   342
 

Definition at line 236 of file llvmAsmParser.cpp.

#define VAR_ID   277
 

Definition at line 171 of file llvmAsmParser.cpp.

#define VOID   263
 

Definition at line 157 of file llvmAsmParser.cpp.

#define VOLATILE   289
 

Definition at line 183 of file llvmAsmParser.cpp.

#define WEAK   297
 

Definition at line 191 of file llvmAsmParser.cpp.

#define XOR   322
 

Definition at line 216 of file llvmAsmParser.cpp.

#define YY_LOCATION_PRINT File,
Loc   )     ((void) 0)
 

Definition at line 2030 of file llvmAsmParser.cpp.

#define YY_REDUCE_PRINT Rule   ) 
 

Definition at line 2132 of file llvmAsmParser.cpp.

#define YY_STACK_PRINT Bottom,
Top   ) 
 

Definition at line 2131 of file llvmAsmParser.cpp.

#define YY_SYMBOL_PRINT Title,
Type,
Value,
Location   ) 
 

Definition at line 2130 of file llvmAsmParser.cpp.

#define YYABORT   goto yyabortlab
 

Definition at line 1959 of file llvmAsmParser.cpp.

#define YYACCEPT   goto yyacceptlab
 

Definition at line 1958 of file llvmAsmParser.cpp.

#define YYBACKUP Token,
Value   ) 
 

Value:

do                \
  if (yychar == YYEMPTY && yylen == 1)        \
    {               \
      yychar = (Token);           \
      yylval = (Value);           \
      yytoken = YYTRANSLATE (yychar);       \
      YYPOPSTACK;           \
      goto yybackup;            \
    }               \
  else                \
    {                 \
      yyerror ("syntax error: cannot back up");\
      YYERROR;              \
    }               \
while (0)

Definition at line 1971 of file llvmAsmParser.cpp.

#define YYBISON   1
 

Definition at line 37 of file llvmAsmParser.cpp.

#define yychar   llvmAsmchar
 

Definition at line 53 of file llvmAsmParser.cpp.

#define yyclearin   (yychar = YYEMPTY)
 

Definition at line 1954 of file llvmAsmParser.cpp.

#define YYCOPY To,
From,
Count   ) 
 

Value:

do          \
  {         \
    register YYSIZE_T yyi;    \
    for (yyi = 0; yyi < (Count); yyi++) \
      (To)[yyi] = (From)[yyi];    \
  }         \
      while (0)

Definition at line 1187 of file llvmAsmParser.cpp.

#define YYDEBUG   0
 

Definition at line 1059 of file llvmAsmParser.cpp.

#define yydebug   llvmAsmdebug
 

Definition at line 54 of file llvmAsmParser.cpp.

#define YYDPRINTF Args   ) 
 

Definition at line 2129 of file llvmAsmParser.cpp.

#define YYEMPTY   (-2)
 

Definition at line 1955 of file llvmAsmParser.cpp.

Referenced by yyerror().

#define YYEOF   0
 

Definition at line 1956 of file llvmAsmParser.cpp.

#define YYERRCODE   256
 

Definition at line 1990 of file llvmAsmParser.cpp.

#define yyerrok   (yyerrstatus = 0)
 

Definition at line 1953 of file llvmAsmParser.cpp.

#define YYERROR   goto yyerrorlab
 

Definition at line 1960 of file llvmAsmParser.cpp.

#define yyerror   llvmAsmerror
 

Definition at line 51 of file llvmAsmParser.cpp.

#define YYERROR_VERBOSE   1
 

Definition at line 1065 of file llvmAsmParser.cpp.

#define YYERROR_VERBOSE   1
 

Definition at line 1065 of file llvmAsmParser.cpp.

#define YYFAIL   goto yyerrlab
 

Definition at line 1967 of file llvmAsmParser.cpp.

#define YYFINAL   4
 

Definition at line 1223 of file llvmAsmParser.cpp.

#define YYFREE   free
 

Definition at line 1128 of file llvmAsmParser.cpp.

#define YYINITDEPTH   200
 

Definition at line 2138 of file llvmAsmParser.cpp.

#define YYLAST   1211
 

Definition at line 1225 of file llvmAsmParser.cpp.

#define YYLEX   yylex ()
 

Definition at line 2040 of file llvmAsmParser.cpp.

#define yylex   llvmAsmlex
 

Definition at line 50 of file llvmAsmParser.cpp.

#define YYLLOC_DEFAULT Current,
Rhs,
 ) 
 

Value:

do                  \
      if (N)                \
  {               \
    (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;  \
    (Current).first_column = YYRHSLOC (Rhs, 1).first_column;  \
    (Current).last_line    = YYRHSLOC (Rhs, N).last_line;   \
    (Current).last_column  = YYRHSLOC (Rhs, N).last_column; \
  }               \
      else                \
  {               \
    (Current).first_line   = (Current).last_line   =    \
      YYRHSLOC (Rhs, 0).last_line;        \
    (Current).first_column = (Current).last_column =    \
      YYRHSLOC (Rhs, 0).last_column;        \
  }               \
    while (0)

Definition at line 1999 of file llvmAsmParser.cpp.

#define YYLSP_NEEDED   0
 

Definition at line 46 of file llvmAsmParser.cpp.

#define yylval   llvmAsmlval
 

Definition at line 52 of file llvmAsmParser.cpp.

#define YYMALLOC   malloc
 

Definition at line 1131 of file llvmAsmParser.cpp.

#define YYMAXDEPTH   10000
 

Definition at line 2149 of file llvmAsmParser.cpp.

#define YYMAXUTOK   343
 

Definition at line 1238 of file llvmAsmParser.cpp.

#define yynerrs   llvmAsmnerrs
 

Definition at line 55 of file llvmAsmParser.cpp.

#define YYNNTS   60
 

Definition at line 1230 of file llvmAsmParser.cpp.

#define YYNRULES   205
 

Definition at line 1232 of file llvmAsmParser.cpp.

#define YYNSTATES   408
 

Definition at line 1234 of file llvmAsmParser.cpp.

#define YYNTOKENS   103
 

Definition at line 1228 of file llvmAsmParser.cpp.

#define YYPACT_NINF   -366
 

Definition at line 1576 of file llvmAsmParser.cpp.

int yyparse   llvmAsmparse
 

Definition at line 49 of file llvmAsmParser.cpp.

Referenced by llvm::RunVMAsmParser().

#define YYPOPSTACK   (yyvsp--, yyssp--)
 

#define YYPURE   0
 

Definition at line 43 of file llvmAsmParser.cpp.

 
#define YYRECOVERING  )     (!!yyerrstatus)
 

Definition at line 1969 of file llvmAsmParser.cpp.

#define YYRHSLOC Rhs,
 )     ((Rhs)[K])
 

Definition at line 1997 of file llvmAsmParser.cpp.

#define YYSIZE_T   unsigned int
 

Definition at line 1950 of file llvmAsmParser.cpp.

#define YYSKELETON_NAME   "yacc.c"
 

Definition at line 40 of file llvmAsmParser.cpp.

#define YYSTACK_ALLOC   YYMALLOC
 

Definition at line 1154 of file llvmAsmParser.cpp.

#define YYSTACK_BYTES  ) 
 

Value:

((N) * (sizeof (short int) + sizeof (YYSTYPE))      \
      + YYSTACK_GAP_MAXIMUM)

Definition at line 1176 of file llvmAsmParser.cpp.

#define YYSTACK_FREE   YYFREE
 

Definition at line 1155 of file llvmAsmParser.cpp.

#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
 

Definition at line 1172 of file llvmAsmParser.cpp.

#define YYSTACK_RELOCATE Stack   ) 
 

Value:

do                  \
      {                 \
  YYSIZE_T yynewbytes;            \
  YYCOPY (&yyptr->Stack, Stack, yysize);        \
  Stack = &yyptr->Stack;            \
  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  yyptr += yynewbytes / sizeof (*yyptr);        \
      }                 \
    while (0)

Definition at line 1203 of file llvmAsmParser.cpp.

#define yystype   YYSTYPE
 

Definition at line 1112 of file llvmAsmParser.cpp.

#define YYSTYPE_IS_DECLARED   1
 

Definition at line 1113 of file llvmAsmParser.cpp.

#define YYSTYPE_IS_TRIVIAL   1
 

Definition at line 1114 of file llvmAsmParser.cpp.

#define YYTABLE_NINF   -103
 

Definition at line 1637 of file llvmAsmParser.cpp.

#define YYTERROR   1
 

Definition at line 1989 of file llvmAsmParser.cpp.

#define YYTRANSLATE YYX   )     ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 

Definition at line 1240 of file llvmAsmParser.cpp.

#define YYUNDEFTOK   2
 

Definition at line 1237 of file llvmAsmParser.cpp.

#define ZEROINITIALIZER   281
 

Definition at line 175 of file llvmAsmParser.cpp.


Typedef Documentation

typedef std::vector<Value *> ValueList
 

Definition at line 290 of file llvmAsmParser.cpp.

typedef short int yysigned_char
 

Definition at line 1219 of file llvmAsmParser.cpp.

typedef union YYSTYPE YYSTYPE
 


Enumeration Type Documentation

enum yytokentype
 

Enumerator:
ESINT64VAL 
EUINT64VAL 
SINTVAL 
UINTVAL 
FPVAL 
VOID 
BOOL 
SBYTE 
UBYTE 
SHORT 
USHORT 
INT 
UINT 
LONG 
ULONG 
FLOAT 
DOUBLE 
TYPE 
LABEL 
VAR_ID 
LABELSTR 
STRINGCONSTANT 
IMPLEMENTATION 
ZEROINITIALIZER 
TRUETOK 
FALSETOK 
BEGINTOK 
ENDTOK 
DECLARE 
GLOBAL 
CONSTANT 
VOLATILE 
TO 
DOTDOTDOT 
NULL_TOK 
UNDEF 
CONST 
INTERNAL 
LINKONCE 
WEAK 
APPENDING 
OPAQUE 
NOT 
EXTERNAL 
TARGET 
TRIPLE 
ENDIAN 
POINTERSIZE 
LITTLE 
BIG 
DEPLIBS 
RET 
BR 
SWITCH 
INVOKE 
UNWIND 
UNREACHABLE 
ADD 
SUB 
MUL 
DIV 
REM 
AND 
OR 
XOR 
SETLE 
SETGE 
SETLT 
SETGT 
SETEQ 
SETNE 
MALLOC 
ALLOCA 
FREE 
LOAD 
STORE 
GETELEMENTPTR 
PHI_TOK 
CALL 
CAST 
SELECT 
SHL 
SHR 
VAARG 
VANEXT 
VA_ARG 

Definition at line 63 of file llvmAsmParser.cpp.


Function Documentation

static BasicBlock* getBBVal const ValID ID,
bool  isDefinition = false
[static]
 

getBBVal - This is used for two purposes: If isDefinition is true, a new basic block with the specified ID is being defined. If isDefinition is true, this is a reference to a basic block, which may or may not be a forward reference.

Definition at line 586 of file llvmAsmParser.cpp.

References llvm::ISD::BasicBlock, PerFunctionInfo::BBForwardRefs, CurFun, PerFunctionInfo::CurrentFunction, llvm::ValID::destroy(), llvm::Function::getBasicBlockList(), llvm::ValID::getName(), inFunctionScope(), llvmAsmlineno, llvm::ValID::Name, llvm::ValID::Num, PerFunctionInfo::NumberedBlocks, llvm::BasicBlock::setName(), llvm::ThrowException(), and llvm::ValID::Type.

static const Type* getTypeVal const ValID D,
bool  DoNotImprovise = false
[static]
 

Definition at line 418 of file llvmAsmParser.cpp.

References CurFun, CurModule, PerModuleInfo::CurrentModule, llvm::ValID::destroy(), llvm::Module::getTypeByName(), I, inFunctionScope(), PerModuleInfo::LateResolveTypes, PerFunctionInfo::LateResolveTypes, llvm::ValID::Name, llvm::ValID::Num, llvm::ThrowException(), llvm::ValID::Type, and PerModuleInfo::Types.

static Value* getVal const Type Ty,
const ValID ID
[static]
 

Definition at line 554 of file llvmAsmParser.cpp.

References CurFun, CurModule, getValNonImprovising(), inFunctionScope(), InsertValue(), PerModuleInfo::LateResolveValues, PerFunctionInfo::LateResolveValues, llvmAsmlineno, PerModuleInfo::PlaceHolderInfo, llvm::ThrowException(), and V.

static Value* getValNonImprovising const Type Ty,
const ValID D
[static]
 

Definition at line 465 of file llvmAsmParser.cpp.

References llvm::ValID::ConstantValue, llvm::ValID::ConstPool64, llvm::ValID::ConstPoolFP, CurFun, CurModule, llvm::ValID::destroy(), llvm::Value::getType(), llvm::itostr(), lookupInSymbolTable(), llvm::ValID::Name, llvm::ValID::Num, second, llvm::ThrowException(), llvm::ValID::Type, llvm::ValID::UConstPool64, llvm::utostr(), PerFunctionInfo::Values, and PerModuleInfo::Values.

Referenced by getVal(), and ResolveDefinitions().

static PATypeHolder HandleUpRefs const Type ty  )  [static]
 

HandleUpRefs - Every time we finish a new layer of types, this function is called. It loops through the UpRefs vector, which is a list of the currently active types. For each type, if the up reference is contained in the newly completed type, we decrement the level count. When the level count reaches zero, the upreferenced type is the type that is passed in: thus we can complete the cycle.

Definition at line 921 of file llvmAsmParser.cpp.

References llvm::Type::getDescription(), llvm::Type::isAbstract(), llvm::DerivedType::refineAbstractTypeTo(), second, TypeContains(), UpRefs, and UR_OUT.

static bool inFunctionScope  )  [static]
 

Definition at line 401 of file llvmAsmParser.cpp.

References CurFun, and PerFunctionInfo::CurrentFunction.

Referenced by getBBVal(), getTypeVal(), getVal(), lookupInSymbolTable(), ResolveTypeTo(), setTypeName(), and setValueName().

static int InsertValue Value V,
std::map< const Type *, ValueList > &  ValueTab = CurFun.Values
[static]
 

Definition at line 408 of file llvmAsmParser.cpp.

References llvm::Value::getType(), and llvm::Value::hasName().

Referenced by getVal(), ParseGlobalVariable(), and ResolveDefinitions().

static Value* lookupInSymbolTable const Type Ty,
const std::string &  Name
[static]
 

Definition at line 454 of file llvmAsmParser.cpp.

References CurFun, CurModule, PerFunctionInfo::CurrentFunction, PerModuleInfo::CurrentModule, llvm::Module::getSymbolTable(), llvm::Function::getSymbolTable(), inFunctionScope(), and llvm::SymbolTable::lookup().

Referenced by getValNonImprovising().

static void ParseGlobalVariable char *  NameStr,
GlobalValue::LinkageTypes  Linkage,
bool  isConstantGlobal,
const Type Ty,
Constant Initializer
[static]
 

ParseGlobalVariable - Handle parsing of a global. If Initializer is null, this is a declaration, otherwise it is a definition.

Definition at line 762 of file llvmAsmParser.cpp.

References CurModule, PerModuleInfo::CurrentModule, PerModuleInfo::GetForwardRefForGlobal(), llvm::Module::getGlobalList(), llvm::Module::getGlobalVariable(), InsertValue(), llvm::GlobalVariable::setConstant(), llvm::GlobalVariable::setInitializer(), llvm::GlobalValue::setLinkage(), llvm::ThrowException(), and PerModuleInfo::Values.

static void ResolveDefinitions std::map< const Type *, ValueList > &  LateResolvers,
std::map< const Type *, ValueList > *  FutureLateResolvers = 0
[static]
 

Definition at line 659 of file llvmAsmParser.cpp.

References CurModule, E, llvm::Type::getDescription(), llvm::ValID::getName(), llvm::Value::getType(), getValNonImprovising(), InsertValue(), llvm::itostr(), llvm::ValID::Num, llvm::ISD::PHI, PerModuleInfo::PlaceHolderInfo, llvm::Value::replaceAllUsesWith(), llvm::ThrowException(), llvm::ValID::Type, and V.

Referenced by PerFunctionInfo::FunctionDone(), and PerModuleInfo::ModuleDone().

static void ResolveTypes std::map< ValID, PATypeHolder > &  LateResolveTypes  )  [static]
 

Definition at line 726 of file llvmAsmParser.cpp.

References llvm::ValID::getName(), llvm::itostr(), llvm::ValID::Num, llvm::ThrowException(), and llvm::ValID::Type.

Referenced by LinkTypes(), and RecursiveResolveTypesI().

static void ResolveTypeTo char *  Name,
const Type ToTy
[static]
 

Definition at line 705 of file llvmAsmParser.cpp.

References CurFun, CurModule, D, I, inFunctionScope(), PerModuleInfo::LateResolveTypes, PerFunctionInfo::LateResolveTypes, PerModuleInfo::Types, and PerFunctionInfo::Types.

static bool setTypeName const Type T,
char *  NameStr
[static]
 

Definition at line 842 of file llvmAsmParser.cpp.

References llvm::Module::addTypeName(), CurModule, PerModuleInfo::CurrentModule, llvm::Type::getDescription(), llvm::Module::getTypeByName(), inFunctionScope(), and llvm::ThrowException().

static void setValueName Value V,
char *  NameStr
[static]
 

Definition at line 741 of file llvmAsmParser.cpp.

References CurFun, PerFunctionInfo::CurrentFunction, llvm::Type::getDescription(), llvm::Function::getSymbolTable(), llvm::Value::getType(), inFunctionScope(), llvm::SymbolTable::lookup(), llvm::Value::setName(), and llvm::ThrowException().

static bool TypeContains const Type Ty,
const Type E
[static]
 

Definition at line 888 of file llvmAsmParser.cpp.

References llvm::Type::subtype_begin(), and llvm::Type::subtype_end().

Referenced by HandleUpRefs().

int yyerror const char *  ErrorMsg  ) 
 

Definition at line 4493 of file llvmAsmParser.cpp.

References llvm::CurFilename, llvmAsmleng, llvmAsmlineno, llvmAsmtext, llvm::ThrowException(), llvm::utostr(), and YYEMPTY.

int yylex  ) 
 

int yyparse  ) 
 

static YYSIZE_T yystrlen yystr   )  const [static]
 


Variable Documentation

BasicBlock* CurBB [static]
 

Definition at line 283 of file llvmAsmParser.cpp.

struct PerFunctionInfo CurFun [static]
 

Referenced by getBBVal(), getTypeVal(), getVal(), getValNonImprovising(), inFunctionScope(), lookupInSymbolTable(), ResolveTypeTo(), and setValueName().

struct PerModuleInfo CurModule [static]
 

Referenced by PerFunctionInfo::FunctionDone(), getTypeVal(), getVal(), getValNonImprovising(), lookupInSymbolTable(), ParseGlobalVariable(), ResolveDefinitions(), ResolveTypeTo(), llvm::RunVMAsmParser(), and setTypeName().

bool ObsoleteVarArgs [static]
 

Definition at line 284 of file llvmAsmParser.cpp.

Referenced by llvm::RunVMAsmParser().

Module* ParserResult [static]
 

Definition at line 265 of file llvmAsmParser.cpp.

std::vector<UpRefRecord> UpRefs [static]
 

Definition at line 912 of file llvmAsmParser.cpp.

Referenced by HandleUpRefs().

int yychar
 

Definition at line 2290 of file llvmAsmParser.cpp.

const short int yycheck[] [static]
 

Definition at line 1764 of file llvmAsmParser.cpp.

const unsigned char yydefact[] [static]
 

Definition at line 1518 of file llvmAsmParser.cpp.

const short int yydefgoto[] [static]
 

Initial value:

{
      -1,    45,   223,   236,   237,   238,   239,   166,   167,   197,
     168,    20,    11,    46,    47,   169,    49,    50,    77,   103,
     287,   257,   288,    94,     1,     2,     3,   150,    64,    90,
     153,    51,   245,   176,   177,   178,    52,    83,    12,    59,
      13,    14,    23,   258,    53,   260,   335,    15,    55,    56,
     143,   388,    85,   204,   336,   337,   144,   306,   145,   146
}

Definition at line 1564 of file llvmAsmParser.cpp.

YYSTYPE yylval
 

Definition at line 2300 of file llvmAsmParser.cpp.

int yynerrs
 

Definition at line 2303 of file llvmAsmParser.cpp.

const short int yypact[] [static]
 

Definition at line 1577 of file llvmAsmParser.cpp.

const short int yypgoto[] [static]
 

Initial value:

{
    -366,  -366,  -366,   246,   260,   262,   263,  -101,  -100,  -365,
    -366,   287,   325,   -21,  -366,   -11,  -366,   -38,   270,  -366,
     -84,   181,  -208,   283,  -366,  -366,  -366,  -366,  -366,  -366,
    -366,     1,  -366,   106,  -366,  -366,   330,  -366,  -366,  -366,
    -366,   353,  -366,  -351,    21,   129,  -104,  -366,   342,  -366,
    -366,  -366,  -366,  -366,    54,    49,  -366,    39,  -366,  -366
}

Definition at line 1623 of file llvmAsmParser.cpp.

const unsigned char yyr1[] [static]
 

Initial value:

{
       0,   103,   104,   104,   105,   105,   106,   106,   106,   106,
     106,   107,   107,   107,   108,   108,   108,   108,   108,   108,
     109,   109,   110,   110,   110,   110,   111,   111,   111,   111,
     112,   112,   113,   113,   114,   114,   115,   115,   115,   115,
     115,   116,   116,   117,   117,   118,   119,   119,   119,   119,
     119,   119,   119,   119,   119,   119,   119,   119,   119,   120,
     120,   120,   120,   120,   120,   120,   120,   120,   120,   121,
     121,   122,   122,   122,   122,   123,   123,   123,   123,   123,
     123,   123,   123,   123,   123,   123,   123,   123,   123,   123,
     123,   124,   124,   124,   124,   124,   124,   124,   125,   125,
     126,   126,   127,   128,   128,   128,   128,   129,   129,   129,
     129,   129,   129,   129,   130,   130,   131,   131,   131,   132,
     133,   133,   133,   134,   134,   135,   135,   136,   137,   137,
     138,   138,   138,   138,   139,   140,   140,   141,   142,   142,
     143,   145,   144,   146,   146,   146,   146,   146,   146,   146,
     146,   146,   147,   147,   148,   148,   149,   150,   150,   151,
     152,   152,   152,   153,   153,   153,   153,   153,   153,   153,
     153,   153,   154,   154,   155,   156,   156,   157,   157,   158,
     158,   159,   159,   159,   159,   159,   159,   159,   159,   159,
     159,   159,   159,   159,   160,   160,   161,   161,   162,   162,
     162,   162,   162,   162,   162,   162
}

Definition at line 1464 of file llvmAsmParser.cpp.

const unsigned char yyr2[] [static]
 

Initial value:

{
       0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     2,     0,     1,     1,     1,     1,
       0,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     2,     4,     5,     5,     3,     2,     2,     1,
       3,     1,     3,     1,     0,     4,     3,     3,     4,     4,
       3,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     6,     5,     8,     6,     6,     6,     6,     3,     1,
       1,     1,     1,     2,     2,     2,     1,     4,     2,     5,
       5,     3,     4,     0,     1,     1,     3,     3,     3,     3,
       3,     1,     0,     1,     1,     1,     0,     2,     3,     1,
       1,     3,     1,     0,     5,     1,     1,     3,     1,     1,
       2,     0,     3,     1,     1,     1,     1,     1,     1,     1,
       3,     1,     1,     1,     1,     1,     2,     2,     2,     3,
       2,     0,     1,     2,     2,     3,     9,     9,     8,    12,
       1,     1,     6,     5,     2,     6,     7,     1,     3,     1,
       0,     5,     5,     5,     2,     4,     4,     6,     4,     4,
       4,     2,     6,     1,     2,     0,     1,     0,     2,     5,
       2,     5,     2,     4,     6,     4
}

Definition at line 1490 of file llvmAsmParser.cpp.

const char* yysrc
 

Definition at line 2190 of file llvmAsmParser.cpp.

const unsigned char yystos[] [static]
 

Definition at line 1892 of file llvmAsmParser.cpp.

const short int yytable[] [static]
 

Definition at line 1638 of file llvmAsmParser.cpp.

const char* const yytname[] [static]
 

Initial value:

{
  "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL",
  "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT",
  "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL",
  "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
  "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK",
  "DECLARE", "GLOBAL", "CONSTANT", "VOLATILE", "TO", "DOTDOTDOT",
  "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE", "WEAK",
  "APPENDING", "OPAQUE", "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN",
  "POINTERSIZE", "LITTLE", "BIG", "DEPLIBS", "RET", "BR", "SWITCH",
  "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "DIV", "REM",
  "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE",
  "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK",
  "CALL", "CAST", "SELECT", "SHL", "SHR", "VAARG", "VANEXT", "VA_ARG",
  "'='", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'",
  "'}'", "'*'", "','", "'c'", "$accept", "INTVAL", "EINT64VAL",
  "ArithmeticOps", "LogicalOps", "SetCondOps", "ShiftOps", "SIntType",
  "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage", "TypesV",
  "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
  "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
  "Module", "FunctionList", "ConstPool", "BigOrLittle", "TargetDefinition",
  "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal",
  "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader",
  "END", "Function", "FunctionProto", "@1", "ConstValueRef",
  "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList",
  "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst",
  "PHIList", "ValueRefList", "ValueRefListE", "InstVal", "IndexList",
  "OptVolatile", "MemoryInst", 0
}

Definition at line 1412 of file llvmAsmParser.cpp.

const unsigned char yytranslate[] [static]
 

Definition at line 1244 of file llvmAsmParser.cpp.

int yytype
 

Definition at line 2257 of file llvmAsmParser.cpp.

YYSTYPE* yyvaluep
 

Definition at line 2259 of file llvmAsmParser.cpp.