mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-23 11:38:38 +00:00
Keep lists of values so they can be examined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32120 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7a33f8d7cd
commit
f8483657b3
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <istream>
|
#include <istream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
// Global variables exported from the lexer...
|
// Global variables exported from the lexer...
|
||||||
|
|
||||||
@ -110,4 +111,7 @@ struct ConstInfo {
|
|||||||
void destroy() { delete cnst; type.destroy(); }
|
void destroy() { delete cnst; type.destroy(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef std::vector<ValueInfo> ValueList;
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -281,15 +281,16 @@
|
|||||||
|
|
||||||
|
|
||||||
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||||
#line 201 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
|
#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
|
||||||
typedef union YYSTYPE {
|
typedef union YYSTYPE {
|
||||||
std::string* String;
|
std::string* String;
|
||||||
TypeInfo Type;
|
TypeInfo Type;
|
||||||
ValueInfo Value;
|
ValueInfo Value;
|
||||||
ConstInfo Const;
|
ConstInfo Const;
|
||||||
|
ValueList* ValList;
|
||||||
} YYSTYPE;
|
} YYSTYPE;
|
||||||
/* Line 1447 of yacc.c. */
|
/* Line 1447 of yacc.c. */
|
||||||
#line 293 "UpgradeParser.tab.h"
|
#line 294 "UpgradeParser.tab.h"
|
||||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
|
@ -281,15 +281,16 @@
|
|||||||
|
|
||||||
|
|
||||||
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
|
||||||
#line 201 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
|
#line 209 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
|
||||||
typedef union YYSTYPE {
|
typedef union YYSTYPE {
|
||||||
std::string* String;
|
std::string* String;
|
||||||
TypeInfo Type;
|
TypeInfo Type;
|
||||||
ValueInfo Value;
|
ValueInfo Value;
|
||||||
ConstInfo Const;
|
ConstInfo Const;
|
||||||
|
ValueList* ValList;
|
||||||
} YYSTYPE;
|
} YYSTYPE;
|
||||||
/* Line 1447 of yacc.c. */
|
/* Line 1447 of yacc.c. */
|
||||||
#line 293 "UpgradeParser.tab.h"
|
#line 294 "UpgradeParser.tab.h"
|
||||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#include "ParserInternals.h"
|
#include "ParserInternals.h"
|
||||||
#include <llvm/ADT/StringExtras.h>
|
#include <llvm/ADT/StringExtras.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -38,6 +37,15 @@ static TypeVector EnumeratedTypes;
|
|||||||
typedef std::map<std::string,TypeInfo> TypeMap;
|
typedef std::map<std::string,TypeInfo> TypeMap;
|
||||||
static TypeMap NamedTypes;
|
static TypeMap NamedTypes;
|
||||||
|
|
||||||
|
void destroy(ValueList* VL) {
|
||||||
|
while (!VL->empty()) {
|
||||||
|
ValueInfo& VI = VL->back();
|
||||||
|
VI.destroy();
|
||||||
|
VL->pop_back();
|
||||||
|
}
|
||||||
|
delete VL;
|
||||||
|
}
|
||||||
|
|
||||||
void UpgradeAssembly(const std::string &infile, std::istream& in,
|
void UpgradeAssembly(const std::string &infile, std::istream& in,
|
||||||
std::ostream &out, bool debug)
|
std::ostream &out, bool debug)
|
||||||
{
|
{
|
||||||
@ -203,6 +211,7 @@ static std::string getCastUpgrade(
|
|||||||
TypeInfo Type;
|
TypeInfo Type;
|
||||||
ValueInfo Value;
|
ValueInfo Value;
|
||||||
ConstInfo Const;
|
ConstInfo Const;
|
||||||
|
ValueList* ValList;
|
||||||
}
|
}
|
||||||
|
|
||||||
%token <Type> VOID BOOL SBYTE UBYTE SHORT USHORT INT UINT LONG ULONG
|
%token <Type> VOID BOOL SBYTE UBYTE SHORT USHORT INT UINT LONG ULONG
|
||||||
@ -236,13 +245,13 @@ static std::string getCastUpgrade(
|
|||||||
%type <String> ArgVal ArgListH ArgList FunctionHeaderH BEGIN FunctionHeader END
|
%type <String> ArgVal ArgListH ArgList FunctionHeaderH BEGIN FunctionHeader END
|
||||||
%type <String> Function FunctionProto BasicBlock TypeListI
|
%type <String> Function FunctionProto BasicBlock TypeListI
|
||||||
%type <String> InstructionList BBTerminatorInst JumpTable Inst PHIList
|
%type <String> InstructionList BBTerminatorInst JumpTable Inst PHIList
|
||||||
%type <String> ValueRefList OptTailCall InstVal IndexList OptVolatile
|
%type <String> OptTailCall InstVal OptVolatile
|
||||||
%type <String> MemoryInst SymbolicValueRef OptSideEffect GlobalType
|
%type <String> MemoryInst SymbolicValueRef OptSideEffect GlobalType
|
||||||
%type <String> FnDeclareLinkage BasicBlockList BigOrLittle AsmBlock
|
%type <String> FnDeclareLinkage BasicBlockList BigOrLittle AsmBlock
|
||||||
%type <String> Name ValueRef ValueRefListE ConstValueRef
|
%type <String> Name ValueRef ConstValueRef ConstVector
|
||||||
%type <String> ShiftOps SetCondOps LogicalOps ArithmeticOps CastOps
|
%type <String> ShiftOps SetCondOps LogicalOps ArithmeticOps CastOps
|
||||||
|
|
||||||
%type <String> ConstVector
|
%type <ValList> ValueRefList ValueRefListE IndexList
|
||||||
|
|
||||||
%type <Type> IntType SIntType UIntType FPType TypesV Types
|
%type <Type> IntType SIntType UIntType FPType TypesV Types
|
||||||
%type <Type> PrimType UpRTypesV UpRTypes
|
%type <Type> PrimType UpRTypesV UpRTypes
|
||||||
@ -558,7 +567,13 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' {
|
|||||||
delete $1; $3.destroy(); delete $4; $5.destroy();
|
delete $1; $3.destroy(); delete $4; $5.destroy();
|
||||||
}
|
}
|
||||||
| GETELEMENTPTR '(' ConstVal IndexList ')' {
|
| GETELEMENTPTR '(' ConstVal IndexList ')' {
|
||||||
*$1 += "(" + *$3.cnst + " " + *$4 + ")";
|
*$1 += "(" + *$3.cnst;
|
||||||
|
for (unsigned i = 0; i < $4->size(); ++i) {
|
||||||
|
ValueInfo& VI = (*$4)[i];
|
||||||
|
*$1 += ", " + *VI.val;
|
||||||
|
VI.destroy();
|
||||||
|
}
|
||||||
|
*$1 += ")";
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
$3.destroy();
|
$3.destroy();
|
||||||
delete $4;
|
delete $4;
|
||||||
@ -971,8 +986,15 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result...
|
|||||||
*O << " ";
|
*O << " ";
|
||||||
if (!$1->empty())
|
if (!$1->empty())
|
||||||
*O << *$1 << " = ";
|
*O << *$1 << " = ";
|
||||||
*O << *$2 << " " << *$3 << " " << *$4.newTy << " " << *$5 << " ("
|
*O << *$2 << " " << *$3 << " " << *$4.newTy << " " << *$5 << " (";
|
||||||
<< *$7 << ") " << *$9 << " " << *$10.newTy << " " << *$11 << " "
|
for (unsigned i = 0; i < $7->size(); ++i) {
|
||||||
|
ValueInfo& VI = (*$7)[i];
|
||||||
|
*O << *VI.val;
|
||||||
|
if (i+1 < $7->size())
|
||||||
|
*O << ", ";
|
||||||
|
VI.destroy();
|
||||||
|
}
|
||||||
|
*O << ") " << *$9 << " " << *$10.newTy << " " << *$11 << " "
|
||||||
<< *$12 << " " << *$13.newTy << " " << *$14 << "\n";
|
<< *$12 << " " << *$13.newTy << " " << *$14 << "\n";
|
||||||
delete $1; delete $2; delete $3; $4.destroy(); delete $5; delete $7;
|
delete $1; delete $2; delete $3; $4.destroy(); delete $5; delete $7;
|
||||||
delete $9; $10.destroy(); delete $11; delete $12; $13.destroy();
|
delete $9; $10.destroy(); delete $11; delete $12; $13.destroy();
|
||||||
@ -1026,17 +1048,19 @@ PHIList
|
|||||||
|
|
||||||
|
|
||||||
ValueRefList
|
ValueRefList
|
||||||
: ResolvedVal { $$ = new std::string(*$1.val); $1.destroy(); }
|
: ResolvedVal {
|
||||||
|
$$ = new ValueList();
|
||||||
|
$$->push_back($1);
|
||||||
|
}
|
||||||
| ValueRefList ',' ResolvedVal {
|
| ValueRefList ',' ResolvedVal {
|
||||||
*$1 += ", " + *$3.val;
|
$1->push_back($3);
|
||||||
$3.destroy();
|
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ValueRefListE - Just like ValueRefList, except that it may also be empty!
|
// ValueRefListE - Just like ValueRefList, except that it may also be empty!
|
||||||
ValueRefListE
|
ValueRefListE
|
||||||
: ValueRefList
|
: ValueRefList { $$ = $1; }
|
||||||
| /*empty*/ { $$ = new std::string(); }
|
| /*empty*/ { $$ = new ValueList(); }
|
||||||
;
|
;
|
||||||
|
|
||||||
OptTailCall
|
OptTailCall
|
||||||
@ -1125,7 +1149,15 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
|
|||||||
*$1 += " " + *$2;
|
*$1 += " " + *$2;
|
||||||
if (!$1->empty())
|
if (!$1->empty())
|
||||||
*$1 += " ";
|
*$1 += " ";
|
||||||
*$1 += *$3.newTy + " " + *$4 + "(" + *$6 + ")";
|
*$1 += *$3.newTy + " " + *$4 + "(";
|
||||||
|
for (unsigned i = 0; i < $6->size(); ++i) {
|
||||||
|
ValueInfo& VI = (*$6)[i];
|
||||||
|
*$1 += *VI.val;
|
||||||
|
if (i+1 < $6->size())
|
||||||
|
*$1 += ", ";
|
||||||
|
VI.destroy();
|
||||||
|
}
|
||||||
|
*$1 += ")";
|
||||||
delete $2; $3.destroy(); delete $4; delete $6;
|
delete $2; $3.destroy(); delete $4; delete $6;
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
@ -1134,11 +1166,8 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
|
|||||||
|
|
||||||
// IndexList - List of indices for GEP based instructions...
|
// IndexList - List of indices for GEP based instructions...
|
||||||
IndexList
|
IndexList
|
||||||
: ',' ValueRefList {
|
: ',' ValueRefList { $$ = $2; }
|
||||||
$2->insert(0, ", ");
|
| /* empty */ { $$ = new ValueList(); }
|
||||||
$$ = $2;
|
|
||||||
}
|
|
||||||
| /* empty */ { $$ = new std::string(); }
|
|
||||||
;
|
;
|
||||||
|
|
||||||
OptVolatile
|
OptVolatile
|
||||||
@ -1194,7 +1223,12 @@ MemoryInst : MALLOC Types OptCAlign {
|
|||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
| GETELEMENTPTR Types ValueRef IndexList {
|
| GETELEMENTPTR Types ValueRef IndexList {
|
||||||
*$1 += " " + *$2.newTy + " " + *$3 + " " + *$4;
|
*$1 += " " + *$2.newTy + " " + *$3;
|
||||||
|
for (unsigned i = 0; i < $4->size(); ++i) {
|
||||||
|
ValueInfo& VI = (*$4)[i];
|
||||||
|
*$1 += ", " + *VI.val;
|
||||||
|
VI.destroy();
|
||||||
|
}
|
||||||
$2.destroy(); delete $3; delete $4;
|
$2.destroy(); delete $3; delete $4;
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#include "ParserInternals.h"
|
#include "ParserInternals.h"
|
||||||
#include <llvm/ADT/StringExtras.h>
|
#include <llvm/ADT/StringExtras.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -38,6 +37,15 @@ static TypeVector EnumeratedTypes;
|
|||||||
typedef std::map<std::string,TypeInfo> TypeMap;
|
typedef std::map<std::string,TypeInfo> TypeMap;
|
||||||
static TypeMap NamedTypes;
|
static TypeMap NamedTypes;
|
||||||
|
|
||||||
|
void destroy(ValueList* VL) {
|
||||||
|
while (!VL->empty()) {
|
||||||
|
ValueInfo& VI = VL->back();
|
||||||
|
VI.destroy();
|
||||||
|
VL->pop_back();
|
||||||
|
}
|
||||||
|
delete VL;
|
||||||
|
}
|
||||||
|
|
||||||
void UpgradeAssembly(const std::string &infile, std::istream& in,
|
void UpgradeAssembly(const std::string &infile, std::istream& in,
|
||||||
std::ostream &out, bool debug)
|
std::ostream &out, bool debug)
|
||||||
{
|
{
|
||||||
@ -203,6 +211,7 @@ static std::string getCastUpgrade(
|
|||||||
TypeInfo Type;
|
TypeInfo Type;
|
||||||
ValueInfo Value;
|
ValueInfo Value;
|
||||||
ConstInfo Const;
|
ConstInfo Const;
|
||||||
|
ValueList* ValList;
|
||||||
}
|
}
|
||||||
|
|
||||||
%token <Type> VOID BOOL SBYTE UBYTE SHORT USHORT INT UINT LONG ULONG
|
%token <Type> VOID BOOL SBYTE UBYTE SHORT USHORT INT UINT LONG ULONG
|
||||||
@ -236,13 +245,13 @@ static std::string getCastUpgrade(
|
|||||||
%type <String> ArgVal ArgListH ArgList FunctionHeaderH BEGIN FunctionHeader END
|
%type <String> ArgVal ArgListH ArgList FunctionHeaderH BEGIN FunctionHeader END
|
||||||
%type <String> Function FunctionProto BasicBlock TypeListI
|
%type <String> Function FunctionProto BasicBlock TypeListI
|
||||||
%type <String> InstructionList BBTerminatorInst JumpTable Inst PHIList
|
%type <String> InstructionList BBTerminatorInst JumpTable Inst PHIList
|
||||||
%type <String> ValueRefList OptTailCall InstVal IndexList OptVolatile
|
%type <String> OptTailCall InstVal OptVolatile
|
||||||
%type <String> MemoryInst SymbolicValueRef OptSideEffect GlobalType
|
%type <String> MemoryInst SymbolicValueRef OptSideEffect GlobalType
|
||||||
%type <String> FnDeclareLinkage BasicBlockList BigOrLittle AsmBlock
|
%type <String> FnDeclareLinkage BasicBlockList BigOrLittle AsmBlock
|
||||||
%type <String> Name ValueRef ValueRefListE ConstValueRef
|
%type <String> Name ValueRef ConstValueRef ConstVector
|
||||||
%type <String> ShiftOps SetCondOps LogicalOps ArithmeticOps CastOps
|
%type <String> ShiftOps SetCondOps LogicalOps ArithmeticOps CastOps
|
||||||
|
|
||||||
%type <String> ConstVector
|
%type <ValList> ValueRefList ValueRefListE IndexList
|
||||||
|
|
||||||
%type <Type> IntType SIntType UIntType FPType TypesV Types
|
%type <Type> IntType SIntType UIntType FPType TypesV Types
|
||||||
%type <Type> PrimType UpRTypesV UpRTypes
|
%type <Type> PrimType UpRTypesV UpRTypes
|
||||||
@ -558,7 +567,13 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' {
|
|||||||
delete $1; $3.destroy(); delete $4; $5.destroy();
|
delete $1; $3.destroy(); delete $4; $5.destroy();
|
||||||
}
|
}
|
||||||
| GETELEMENTPTR '(' ConstVal IndexList ')' {
|
| GETELEMENTPTR '(' ConstVal IndexList ')' {
|
||||||
*$1 += "(" + *$3.cnst + " " + *$4 + ")";
|
*$1 += "(" + *$3.cnst;
|
||||||
|
for (unsigned i = 0; i < $4->size(); ++i) {
|
||||||
|
ValueInfo& VI = (*$4)[i];
|
||||||
|
*$1 += ", " + *VI.val;
|
||||||
|
VI.destroy();
|
||||||
|
}
|
||||||
|
*$1 += ")";
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
$3.destroy();
|
$3.destroy();
|
||||||
delete $4;
|
delete $4;
|
||||||
@ -971,8 +986,15 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result...
|
|||||||
*O << " ";
|
*O << " ";
|
||||||
if (!$1->empty())
|
if (!$1->empty())
|
||||||
*O << *$1 << " = ";
|
*O << *$1 << " = ";
|
||||||
*O << *$2 << " " << *$3 << " " << *$4.newTy << " " << *$5 << " ("
|
*O << *$2 << " " << *$3 << " " << *$4.newTy << " " << *$5 << " (";
|
||||||
<< *$7 << ") " << *$9 << " " << *$10.newTy << " " << *$11 << " "
|
for (unsigned i = 0; i < $7->size(); ++i) {
|
||||||
|
ValueInfo& VI = (*$7)[i];
|
||||||
|
*O << *VI.val;
|
||||||
|
if (i+1 < $7->size())
|
||||||
|
*O << ", ";
|
||||||
|
VI.destroy();
|
||||||
|
}
|
||||||
|
*O << ") " << *$9 << " " << *$10.newTy << " " << *$11 << " "
|
||||||
<< *$12 << " " << *$13.newTy << " " << *$14 << "\n";
|
<< *$12 << " " << *$13.newTy << " " << *$14 << "\n";
|
||||||
delete $1; delete $2; delete $3; $4.destroy(); delete $5; delete $7;
|
delete $1; delete $2; delete $3; $4.destroy(); delete $5; delete $7;
|
||||||
delete $9; $10.destroy(); delete $11; delete $12; $13.destroy();
|
delete $9; $10.destroy(); delete $11; delete $12; $13.destroy();
|
||||||
@ -1026,17 +1048,19 @@ PHIList
|
|||||||
|
|
||||||
|
|
||||||
ValueRefList
|
ValueRefList
|
||||||
: ResolvedVal { $$ = new std::string(*$1.val); $1.destroy(); }
|
: ResolvedVal {
|
||||||
|
$$ = new ValueList();
|
||||||
|
$$->push_back($1);
|
||||||
|
}
|
||||||
| ValueRefList ',' ResolvedVal {
|
| ValueRefList ',' ResolvedVal {
|
||||||
*$1 += ", " + *$3.val;
|
$1->push_back($3);
|
||||||
$3.destroy();
|
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ValueRefListE - Just like ValueRefList, except that it may also be empty!
|
// ValueRefListE - Just like ValueRefList, except that it may also be empty!
|
||||||
ValueRefListE
|
ValueRefListE
|
||||||
: ValueRefList
|
: ValueRefList { $$ = $1; }
|
||||||
| /*empty*/ { $$ = new std::string(); }
|
| /*empty*/ { $$ = new ValueList(); }
|
||||||
;
|
;
|
||||||
|
|
||||||
OptTailCall
|
OptTailCall
|
||||||
@ -1125,7 +1149,15 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
|
|||||||
*$1 += " " + *$2;
|
*$1 += " " + *$2;
|
||||||
if (!$1->empty())
|
if (!$1->empty())
|
||||||
*$1 += " ";
|
*$1 += " ";
|
||||||
*$1 += *$3.newTy + " " + *$4 + "(" + *$6 + ")";
|
*$1 += *$3.newTy + " " + *$4 + "(";
|
||||||
|
for (unsigned i = 0; i < $6->size(); ++i) {
|
||||||
|
ValueInfo& VI = (*$6)[i];
|
||||||
|
*$1 += *VI.val;
|
||||||
|
if (i+1 < $6->size())
|
||||||
|
*$1 += ", ";
|
||||||
|
VI.destroy();
|
||||||
|
}
|
||||||
|
*$1 += ")";
|
||||||
delete $2; $3.destroy(); delete $4; delete $6;
|
delete $2; $3.destroy(); delete $4; delete $6;
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
@ -1134,11 +1166,8 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
|
|||||||
|
|
||||||
// IndexList - List of indices for GEP based instructions...
|
// IndexList - List of indices for GEP based instructions...
|
||||||
IndexList
|
IndexList
|
||||||
: ',' ValueRefList {
|
: ',' ValueRefList { $$ = $2; }
|
||||||
$2->insert(0, ", ");
|
| /* empty */ { $$ = new ValueList(); }
|
||||||
$$ = $2;
|
|
||||||
}
|
|
||||||
| /* empty */ { $$ = new std::string(); }
|
|
||||||
;
|
;
|
||||||
|
|
||||||
OptVolatile
|
OptVolatile
|
||||||
@ -1194,7 +1223,12 @@ MemoryInst : MALLOC Types OptCAlign {
|
|||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
| GETELEMENTPTR Types ValueRef IndexList {
|
| GETELEMENTPTR Types ValueRef IndexList {
|
||||||
*$1 += " " + *$2.newTy + " " + *$3 + " " + *$4;
|
*$1 += " " + *$2.newTy + " " + *$3;
|
||||||
|
for (unsigned i = 0; i < $4->size(); ++i) {
|
||||||
|
ValueInfo& VI = (*$4)[i];
|
||||||
|
*$1 += ", " + *VI.val;
|
||||||
|
VI.destroy();
|
||||||
|
}
|
||||||
$2.destroy(); delete $3; delete $4;
|
$2.destroy(); delete $3; delete $4;
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user