diff options
-rw-r--r-- | CREDITS.TXT | 4 | ||||
-rw-r--r-- | docs/BytecodeFormat.html | 6 | ||||
-rw-r--r-- | docs/LangRef.html | 6 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAG.h | 11 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 4 | ||||
-rw-r--r-- | include/llvm/Instructions.h | 40 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.cpp.cvs | 7116 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.h.cvs | 448 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 8 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y.cvs | 8 | ||||
-rw-r--r-- | lib/Bytecode/Reader/Reader.cpp | 24 | ||||
-rw-r--r-- | lib/Bytecode/Writer/Writer.cpp | 32 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 70 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 33 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 12 | ||||
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 7 | ||||
-rw-r--r-- | lib/VMCore/Instructions.cpp | 42 | ||||
-rw-r--r-- | test/Assembler/2007-04-20-AlignedLoad.ll | 7 | ||||
-rw-r--r-- | test/Assembler/2007-04-20-AlignedStore.ll | 7 |
19 files changed, 3502 insertions, 4383 deletions
diff --git a/CREDITS.TXT b/CREDITS.TXT index 58cc043ac2..fe0b4fe68a 100644 --- a/CREDITS.TXT +++ b/CREDITS.TXT @@ -118,6 +118,10 @@ N: Sumant Kowshik E: kowshik@uiuc.edu D: Author of the original C backend +N: Christopher Lamb +E: christopher.lamb@gmail.com +D: aligned load/store support + N: Jim Laskey E: jlaskey@apple.com D: Improvements to the PPC backend, instruction scheduling diff --git a/docs/BytecodeFormat.html b/docs/BytecodeFormat.html index 8cb072bb9d..56fc0afce9 100644 --- a/docs/BytecodeFormat.html +++ b/docs/BytecodeFormat.html @@ -1587,15 +1587,15 @@ possible. </p> <tr><td>Call+FastCC+TailCall</td><td>59</td><td>5</td><td>1.5</td></tr> <tr><td>Call+FastCC</td><td>60</td><td>5</td><td>1.5</td></tr> <tr><td>Call+CCC+TailCall</td><td>61</td><td>5</td><td>1.5</td></tr> - <tr><td>Load+Volatile</td><td>62</td><td>3</td><td>1.3</td></tr> - <tr><td>Store+Volatile</td><td>63</td><td>3</td><td>1.3</td></tr> + <tr><td>Load+Attributes</td><td>62</td><td>7</td><td>2.0</td></tr> + <tr><td>Store+Attributes</td><td>63</td><td>7</td><td>2.0</td></tr> </tbody> </table> <p><b><a name="pi_note">* Note: </a></b> These aren't really opcodes from an LLVM language perspective. They encode information into other opcodes without reserving space for that information. -For example, opcode=63 is a Volatile Store. The opcode for this +For example, opcode=63 is an Attributed Store. The opcode for this instruction is 25 (Store) but we encode it as 63 to indicate that is a Volatile Store. The same is done for the calling conventions and tail calls. In each of these entries in range 56-63, the opcode is documented as the base diff --git a/docs/LangRef.html b/docs/LangRef.html index 057fb9cdf8..c615bb3c50 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -2609,7 +2609,7 @@ instructions), the memory is reclaimed.</p> Instruction</a> </div> <div class="doc_text"> <h5>Syntax:</h5> -<pre> <result> = load <ty>* <pointer><br> <result> = volatile load <ty>* <pointer><br></pre> +<pre> <result> = load <ty>* <pointer>[, align <alignment>]<br> <result> = volatile load <ty>* <pointer>[, align <alignment>]<br></pre> <h5>Overview:</h5> <p>The '<tt>load</tt>' instruction is used to read from memory.</p> <h5>Arguments:</h5> @@ -2634,8 +2634,8 @@ instructions. </p> Instruction</a> </div> <div class="doc_text"> <h5>Syntax:</h5> -<pre> store <ty> <value>, <ty>* <pointer> <i>; yields {void}</i> - volatile store <ty> <value>, <ty>* <pointer> <i>; yields {void}</i> +<pre> store <ty> <value>, <ty>* <pointer>[, align <alignment>] <i>; yields {void}</i> + volatile store <ty> <value>, <ty>* <pointer>[, align <alignment>] <i>; yields {void}</i> </pre> <h5>Overview:</h5> <p>The '<tt>store</tt>' instruction is used to write to memory.</p> diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 0f17e6993a..9d8024b86d 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -311,10 +311,12 @@ public: /// determined by their operands, and they produce a value AND a token chain. /// SDOperand getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, - const Value *SV, int SVOffset, bool isVolatile=false); + const Value *SV, int SVOffset, bool isVolatile=false, + unsigned Alignment=0); SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, const Value *SV, - int SVOffset, MVT::ValueType EVT, bool isVolatile=false); + int SVOffset, MVT::ValueType EVT, bool isVolatile=false, + unsigned Alignment=0); SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base, SDOperand Offset, ISD::MemIndexedMode AM); SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain, @@ -323,10 +325,11 @@ public: /// getStore - Helper function to build ISD::STORE nodes. /// SDOperand getStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, - const Value *SV, int SVOffset, bool isVolatile=false); + const Value *SV, int SVOffset, bool isVolatile=false, + unsigned Alignment=0); SDOperand getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr, const Value *SV, int SVOffset, MVT::ValueType TVT, - bool isVolatile=false); + bool isVolatile=false, unsigned Alignment=0); SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base, SDOperand Offset, ISD::MemIndexedMode AM); diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 77d607a2cb..f617800d03 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -1448,7 +1448,7 @@ protected: friend class SelectionDAG; LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT, - const Value *SV, int O=0, unsigned Align=1, bool Vol=false) + const Value *SV, int O=0, unsigned Align=0, bool Vol=false) : SDNode(ISD::LOAD, VTs), AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { @@ -1456,6 +1456,7 @@ protected: Ops[1] = ChainPtrOff[1]; // Ptr Ops[2] = ChainPtrOff[2]; // Off InitOperands(Ops, 3); + assert(Align != 0 && "Loads should have non-zero aligment"); assert((getOffset().getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) && "Only indexed load has a non-undef offset operand"); @@ -1518,6 +1519,7 @@ protected: Ops[2] = ChainValuePtrOff[2]; // Ptr Ops[3] = ChainValuePtrOff[3]; // Off InitOperands(Ops, 4); + assert(Align != 0 && "Stores should have non-zero aligment"); assert((getOffset().getOpcode() == ISD::UNDEF || AddrMode != ISD::UNINDEXED) && "Only indexed store has a non-undef offset operand"); diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 2387739720..0a61d120c2 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -211,9 +211,11 @@ public: /// SubclassData field in Value to store whether or not the load is volatile. /// class LoadInst : public UnaryInstruction { + LoadInst(const LoadInst &LI) : UnaryInstruction(LI.getType(), Load, LI.getOperand(0)) { setVolatile(LI.isVolatile()); + setAlignment(LI.getAlignment()); #ifndef NDEBUG AssertOK(); @@ -223,14 +225,16 @@ class LoadInst : public UnaryInstruction { public: LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore); LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd); - LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, + LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, + Instruction *InsertBefore = 0); + LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, unsigned Align, Instruction *InsertBefore = 0); LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, BasicBlock *InsertAtEnd); LoadInst(Value *Ptr, const char *Name, Instruction *InsertBefore); LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAtEnd); - explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, + explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, Instruction *InsertBefore = 0); LoadInst(Value *Ptr, const char *Name, bool isVolatile, BasicBlock *InsertAtEnd); @@ -238,14 +242,23 @@ public: /// isVolatile - Return true if this is a load from a volatile memory /// location. /// - bool isVolatile() const { return SubclassData; } + bool isVolatile() const { return SubclassData & 1; } /// setVolatile - Specify whether this is a volatile load or not. /// - void setVolatile(bool V) { SubclassData = V; } + void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; } virtual LoadInst *clone() const; + /// getAlignment - Return the alignment of the access that is being performed + /// + unsigned getAlignment() const { + signed Log2AlignVal = ((SubclassData>>1)-1); + return ((Log2AlignVal < 0) ? 0 : 1<<Log2AlignVal); + } + + void setAlignment(unsigned Align); + Value *getPointerOperand() { return getOperand(0); } const Value *getPointerOperand() const { return getOperand(0); } static unsigned getPointerOperandIndex() { return 0U; } @@ -269,10 +282,13 @@ public: /// class StoreInst : public Instruction { Use Ops[2]; + StoreInst(const StoreInst &SI) : Instruction(SI.getType(), Store, Ops, 2) { Ops[0].init(SI.Ops[0], this); Ops[1].init(SI.Ops[1], this); setVolatile(SI.isVolatile()); + setAlignment(SI.getAlignment()); + #ifndef NDEBUG AssertOK(); #endif @@ -283,17 +299,19 @@ public: StoreInst(Value *Val, Value *Ptr, BasicBlock *InsertAtEnd); StoreInst(Value *Val, Value *Ptr, bool isVolatile = false, Instruction *InsertBefore = 0); + StoreInst(Value *Val, Value *Ptr, bool isVolatile, + unsigned Align, Instruction *InsertBefore = 0); StoreInst(Value *Val, Value *Ptr, bool isVolatile, BasicBlock *InsertAtEnd); /// isVolatile - Return true if this is a load from a volatile memory /// location. /// - bool isVolatile() const { return SubclassData; } + bool isVolatile() const { return SubclassData & 1; } /// setVolatile - Specify whether this is a volatile load or not. /// - void setVolatile(bool V) { SubclassData = V; } + void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; } /// Transparently provide more efficient getOperand methods. Value *getOperand(unsigned i) const { @@ -306,7 +324,15 @@ public: } unsigned getNumOperands() const { return 2; } - + /// getAlignment - Return the alignment of the access that is being performed + /// + unsigned getAlignment() const { + signed Log2AlignVal = ((SubclassData>>1)-1); + return ((Log2AlignVal < 0) ? 0 : 1<<Log2AlignVal); + } + + void setAlignment(unsigned Align); + virtual StoreInst *clone() const; Value *getPointerOperand() { return getOperand(1); } diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs index 4108df2c14..410aec381d 100644 --- a/lib/AsmParser/llvmAsmParser.cpp.cvs +++ b/lib/AsmParser/llvmAsmParser.cpp.cvs @@ -1,342 +1,150 @@ -/* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* A Bison parser, made from /Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y + by GNU Bison version 1.28 */ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ +#define YYBISON 1 /* Identify Bison output. */ -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - ESAPINTVAL = 260, - EUAPINTVAL = 261, - LOCALVAL_ID = 262, - GLOBALVAL_ID = 263, - FPVAL = 264, - VOID = 265, - INTTYPE = 266, - FLOAT = 267, - DOUBLE = 268, - LABEL = 269, - TYPE = 270, - LOCALVAR = 271, - GLOBALVAR = 272, - LABELSTR = 273, - STRINGCONSTANT = 274, - ATSTRINGCONSTANT = 275, - ZEROINITIALIZER = 276, - TRUETOK = 277, - FALSETOK = 278, - BEGINTOK = 279, - ENDTOK = 280, - DECLARE = 281, - DEFINE = 282, - GLOBAL = 283, - CONSTANT = 284, - SECTION = 285, - VOLATILE = 286, - THREAD_LOCAL = 287, - TO = 288, - DOTDOTDOT = 289, - NULL_TOK = 290, - UNDEF = 291, - INTERNAL = 292, - LINKONCE = 293, - WEAK = 294, - APPENDING = 295, - DLLIMPORT = 296, - DLLEXPORT = 297, - EXTERN_WEAK = 298, - OPAQUE = 299, - EXTERNAL = 300, - TARGET = 301, - TRIPLE = 302, - ALIGN = 303, - DEPLIBS = 304, - CALL = 305, - TAIL = 306, - ASM_TOK = 307, - MODULE = 308, - SIDEEFFECT = 309, - CC_TOK = 310, - CCC_TOK = 311, - FASTCC_TOK = 312, - COLDCC_TOK = 313, - X86_STDCALLCC_TOK = 314, - X86_FASTCALLCC_TOK = 315, - DATALAYOUT = 316, - RET = 317, - BR = 318, - SWITCH = 319, - INVOKE = 320, - UNWIND = 321, - UNREACHABLE = 322, - ADD = 323, - SUB = 324, - MUL = 325, - UDIV = 326, - SDIV = 327, - FDIV = 328, - UREM = 329, - SREM = 330, - FREM = 331, - AND = 332, - OR = 333, - XOR = 334, - SHL = 335, - LSHR = 336, - ASHR = 337, - ICMP = 338, - FCMP = 339, - EQ = 340, - NE = 341, - SLT = 342, - SGT = 343, - SLE = 344, - SGE = 345, - ULT = 346, - UGT = 347, - ULE = 348, - UGE = 349, - OEQ = 350, - ONE = 351, - OLT = 352, - OGT = 353, - OLE = 354, - OGE = 355, - ORD = 356, - UNO = 357, - UEQ = 358, - UNE = 359, - MALLOC = 360, - ALLOCA = 361, - FREE = 362, - LOAD = 363, - STORE = 364, - GETELEMENTPTR = 365, - TRUNC = 366, - ZEXT = 367, - SEXT = 368, - FPTRUNC = 369, - FPEXT = 370, - BITCAST = 371, - UITOFP = 372, - SITOFP = 373, - FPTOUI = 374, - FPTOSI = 375, - INTTOPTR = 376, - PTRTOINT = 377, - PHI_TOK = 378, - SELECT = 379, - VAARG = 380, - EXTRACTELEMENT = 381, - INSERTELEMENT = 382, - SHUFFLEVECTOR = 383, - NORETURN = 384, - INREG = 385, - SRET = 386, - NOUNWIND = 387, - DEFAULT = 388, - HIDDEN = 389 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define ESAPINTVAL 260 -#define EUAPINTVAL 261 -#define LOCALVAL_ID 262 -#define GLOBALVAL_ID 263 -#define FPVAL 264 -#define VOID 265 -#define INTTYPE 266 -#define FLOAT 267 -#define DOUBLE 268 -#define LABEL 269 -#define TYPE 270 -#define LOCALVAR 271 -#define GLOBALVAR 272 -#define LABELSTR 273 -#define STRINGCONSTANT 274 -#define ATSTRINGCONSTANT 275 -#define ZEROINITIALIZER 276 -#define TRUETOK 277 -#define FALSETOK 278 -#define BEGINTOK 279 -#define ENDTOK 280 -#define DECLARE 281 -#define DEFINE 282 -#define GLOBAL 283 -#define CONSTANT 284 -#define SECTION 285 -#define VOLATILE 286 -#define THREAD_LOCAL 287 -#define TO 288 -#define DOTDOTDOT 289 -#define NULL_TOK 290 -#define UNDEF 291 -#define INTERNAL 292 -#define LINKONCE 293 -#define WEAK 294 -#define APPENDING 295 -#define DLLIMPORT 296 -#define DLLEXPORT 297 -#define EXTERN_WEAK 298 -#define OPAQUE 299 -#define EXTERNAL 300 -#define TARGET 301 -#define TRIPLE 302 -#define ALIGN 303 -#define DEPLIBS 304 -#define CALL 305 -#define TAIL 306 -#define ASM_TOK 307 -#define MODULE 308 -#define SIDEEFFECT 309 -#define CC_TOK 310 -#define CCC_TOK 311 -#define FASTCC_TOK 312 -#define COLDCC_TOK 313 -#define X86_STDCALLCC_TOK 314 -#define X86_FASTCALLCC_TOK 315 -#define DATALAYOUT 316 -#define RET 317 -#define BR 318 -#define SWITCH 319 -#define INVOKE 320 -#define UNWIND 321 -#define UNREACHABLE 322 -#define ADD 323 -#define SUB 324 -#define MUL 325 -#define UDIV 326 -#define SDIV 327 -#define FDIV 328 -#define UREM 329 -#define SREM 330 -#define FREM 331 -#define AND 332 -#define OR 333 -#define XOR 334 -#define SHL 335 -#define LSHR 336 -#define ASHR 337 -#define ICMP 338 -#define FCMP 339 -#define EQ 340 -#define NE 341 -#define SLT 342 -#define SGT 343 -#define SLE 344 -#define SGE 345 -#define ULT 346 -#define UGT 347 -#define ULE 348 -#define UGE 349 -#define OEQ 350 -#define ONE 351 -#define OLT 352 -#define OGT 353 -#define OLE 354 -#define OGE 355 -#define ORD 356 -#define UNO 357 -#define UEQ 358 -#define UNE 359 -#define MALLOC 360 -#define ALLOCA 361 -#define FREE 362 -#define LOAD 363 -#define STORE 364 -#define GETELEMENTPTR 365 -#define TRUNC 366 -#define ZEXT 367 -#define SEXT 368 -#define FPTRUNC 369 -#define FPEXT 370 -#define BITCAST 371 -#define UITOFP 372 -#define SITOFP 373 -#define FPTOUI 374 -#define FPTOSI 375 -#define INTTOPTR 376 -#define PTRTOINT 377 -#define PHI_TOK 378 -#define SELECT 379 -#define VAARG 380 -#define EXTRACTELEMENT 381 -#define INSERTELEMENT 382 -#define SHUFFLEVECTOR 383 -#define NORETURN 384 -#define INREG 385 -#define SRET 386 -#define NOUNWIND 387 -#define DEFAULT 388 -#define HIDDEN 389 - - - - -/* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define ESAPINTVAL 259 +#define EUAPINTVAL 260 +#define LOCALVAL_ID 261 +#define GLOBALVAL_ID 262 +#define FPVAL 263 +#define VOID 264 +#define INTTYPE 265 +#define FLOAT 266 +#define DOUBLE 267 +#define LABEL 268 +#define TYPE 269 +#define LOCALVAR 270 +#define GLOBALVAR 271 +#define LABELSTR 272 +#define STRINGCONSTANT 273 +#define ATSTRINGCONSTANT 274 +#define ZEROINITIALIZER 275 +#define TRUETOK 276 +#define FALSETOK 277 +#define BEGINTOK 278 +#define ENDTOK 279 +#define DECLARE 280 +#define DEFINE 281 +#define GLOBAL 282 +#define CONSTANT 283 +#define SECTION 284 +#define VOLATILE 285 +#define THREAD_LOCAL 286 +#define TO 287 +#define DOTDOTDOT 288 +#define NULL_TOK 289 +#define UNDEF 290 +#define INTERNAL 291 +#define LINKONCE 292 +#define WEAK 293 +#define APPENDING 294 +#define DLLIMPORT 295 +#define DLLEXPORT 296 +#define EXTERN_WEAK 297 +#define OPAQUE 298 +#define EXTERNAL 299 +#define TARGET 300 +#define TRIPLE 301 +#define ALIGN 302 +#define DEPLIBS 303 +#define CALL 304 +#define TAIL 305 +#define ASM_TOK 306 +#define MODULE 307 +#define SIDEEFFECT 308 +#define CC_TOK 309 +#define CCC_TOK 310 +#define FASTCC_TOK 311 +#define COLDCC_TOK 312 +#define X86_STDCALLCC_TOK 313 +#define X86_FASTCALLCC_TOK 314 +#define DATALAYOUT 315 +#define RET 316 +#define BR 317 +#define SWITCH 318 +#define INVOKE 319 +#define UNWIND 320 +#define UNREACHABLE 321 +#define ADD 322 +#define SUB 323 +#define MUL 324 +#define UDIV 325 +#define SDIV 326 +#define FDIV 327 +#define UREM 328 +#define SREM 329 +#define FREM 330 +#define AND 331 +#define OR 332 +#define XOR 333 +#define SHL 334 +#define LSHR 335 +#define ASHR 336 +#define ICMP 337 +#define FCMP 338 +#define EQ 339 +#define NE 340 +#define SLT 341 +#define SGT 342 +#define SLE 343 +#define SGE 344 +#define ULT 345 +#define UGT 346 +#define ULE 347 +#define UGE 348 +#define OEQ 349 +#define ONE 350 +#define OLT 351 +#define OGT 352 +#define OLE 353 +#define OGE 354 +#define ORD 355 +#define UNO 356 +#define UEQ 357 +#define UNE 358 +#define MALLOC 359 +#define ALLOCA 360 +#define FREE 361 +#define LOAD 362 +#define STORE 363 +#define GETELEMENTPTR 364 +#define TRUNC 365 +#define ZEXT 366 +#define SEXT 367 +#define FPTRUNC 368 +#define FPEXT 369 +#define BITCAST 370 +#define UITOFP 371 +#define SITOFP 372 +#define FPTOUI 373 +#define FPTOSI 374 +#define INTTOPTR 375 +#define PTRTOINT 376 +#define PHI_TOK 377 +#define SELECT 378 +#define VAARG 379 +#define EXTRACTELEMENT 380 +#define INSERTELEMENT 381 +#define SHUFFLEVECTOR 382 +#define NORETURN 383 +#define INREG 384 +#define SRET 385 +#define NOUNWIND 386 +#define DEFAULT 387 +#define HIDDEN 388 + +#line 14 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1260,28 +1068,8 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) { } - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 938 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y" -typedef union YYSTYPE { +#line 938 "/Users/clamb/Documents/ageia/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1327,1499 +1115,1068 @@ typedef union YYSTYPE { llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; -/* Line 196 of yacc.c. */ -#line 1332 "llvmAsmParser.tab.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - +#include <stdio.h> -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 1344 "llvmAsmParser.tab.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t +#ifndef __cplusplus +#ifndef __STDC__ +#define const #endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif #endif -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +#define YYFINAL 565 +#define YYFLAG -32768 +#define YYNTBASE 149 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 388 ? yytranslate[x] : 227) + +static const short yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 139, + 140, 137, 2, 136, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 144, + 135, 145, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 141, 138, 143, 2, 2, 2, 2, 2, 148, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 142, + 2, 2, 146, 2, 147, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |