From 91ef460285021b5bf43b3850f0f8958a09b8939c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 31 Mar 2004 03:49:47 +0000 Subject: [PATCH] Avoid TRUE and FALSE which apparently conflict with some macros on OSX git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12566 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/Lexer.l | 4 ++-- lib/AsmParser/llvmAsmParser.y | 10 +++++----- projects/Stacker/lib/compiler/Lexer.l | 8 ++++---- projects/Stacker/lib/compiler/StackerCompiler.cpp | 4 ++-- projects/Stacker/lib/compiler/StackerParser.y | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/AsmParser/Lexer.l b/lib/AsmParser/Lexer.l index 3203fe5b518..510fedb8698 100644 --- a/lib/AsmParser/Lexer.l +++ b/lib/AsmParser/Lexer.l @@ -174,8 +174,8 @@ HexIntConstant [us]0x[0-9A-Fa-f]+ begin { return BEGINTOK; } end { return ENDTOK; } -true { return TRUE; } -false { return FALSE; } +true { return TRUETOK; } +false { return FALSETOK; } declare { return DECLARE; } global { return GLOBAL; } constant { return CONSTANT; } diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 88e75e3da2b..ae56c1d23a6 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -857,7 +857,7 @@ using namespace llvm; %type Name OptName OptAssign -%token IMPLEMENTATION ZEROINITIALIZER TRUE FALSE BEGINTOK ENDTOK +%token IMPLEMENTATION ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK %token DECLARE GLOBAL CONSTANT VOLATILE %token TO DOTDOTDOT NULL_TOK CONST INTERNAL LINKONCE WEAK APPENDING %token OPAQUE NOT EXTERNAL TARGET ENDIAN POINTERSIZE LITTLE BIG @@ -1210,10 +1210,10 @@ ConstVal : SIntType EINT64VAL { // integral constants ThrowException("Constant value doesn't fit in type!"); $$ = ConstantUInt::get($1, $2); } - | BOOL TRUE { // Boolean constants + | BOOL TRUETOK { // Boolean constants $$ = ConstantBool::True; } - | BOOL FALSE { // Boolean constants + | BOOL FALSETOK { // Boolean constants $$ = ConstantBool::False; } | FPType FPVAL { // Float & Double constants @@ -1550,10 +1550,10 @@ ConstValueRef : ESINT64VAL { // A reference to a direct constant | FPVAL { // Perhaps it's an FP constant? $$ = ValID::create($1); } - | TRUE { + | TRUETOK { $$ = ValID::create(ConstantBool::True); } - | FALSE { + | FALSETOK { $$ = ValID::create(ConstantBool::False); } | NULL_TOK { diff --git a/projects/Stacker/lib/compiler/Lexer.l b/projects/Stacker/lib/compiler/Lexer.l index 6087f883e5c..65f1a972d66 100644 --- a/projects/Stacker/lib/compiler/Lexer.l +++ b/projects/Stacker/lib/compiler/Lexer.l @@ -117,10 +117,10 @@ OutChar \>c {Colon} { return COLON; } {Semi} { return SEMI; } -TRUE { return TRUE; } -FALSE { return FALSE; } -ON { return TRUE; } -OFF { return FALSE; } +TRUE { return TRUETOK; } +FALSE { return FALSETOK; } +ON { return TRUETOK; } +OFF { return FALSETOK; } {Less} { return LESS; } LT { return LESS; } {More} { return MORE; } diff --git a/projects/Stacker/lib/compiler/StackerCompiler.cpp b/projects/Stacker/lib/compiler/StackerCompiler.cpp index 11839793891..12151a537d6 100644 --- a/projects/Stacker/lib/compiler/StackerCompiler.cpp +++ b/projects/Stacker/lib/compiler/StackerCompiler.cpp @@ -820,13 +820,13 @@ StackerCompiler::handle_word( int tkn ) } // Logical Operations - case TRUE : // -- -1 + case TRUETOK : // -- -1 { if (echo) bb->setName("TRUE"); push_integer(bb,-1); break; } - case FALSE : // -- 0 + case FALSETOK : // -- 0 { if (echo) bb->setName("FALSE"); push_integer(bb,0); diff --git a/projects/Stacker/lib/compiler/StackerParser.y b/projects/Stacker/lib/compiler/StackerParser.y index 59139122a28..e45cc1a4b38 100644 --- a/projects/Stacker/lib/compiler/StackerParser.y +++ b/projects/Stacker/lib/compiler/StackerParser.y @@ -55,7 +55,7 @@ int yyparse(); /* Terminal Tokens */ %token SEMI COLON FORWARD MAIN DUMP -%token TRUE FALSE LESS MORE LESS_EQUAL MORE_EQUAL NOT_EQUAL EQUAL +%token TRUETOK FALSETOK LESS MORE LESS_EQUAL MORE_EQUAL NOT_EQUAL EQUAL %token PLUS MINUS INCR DECR MULT DIV MODULUS NEGATE ABS MIN MAX STAR_SLASH %token AND OR XOR LSHIFT RSHIFT %token DROP DROP2 NIP NIP2 DUP DUP2 SWAP SWAP2 OVER OVER2 ROT ROT2 @@ -109,8 +109,8 @@ Word : STRING { $$ = SCI->handle_string( $1 ); } ; Word : INTEGER { $$ = SCI->handle_integer( $1 ); } ; /* Everything else is a terminal symbol and goes to handle_word */ -Word : TRUE { $$ = SCI->handle_word( TRUE ); } ; -Word : FALSE { $$ = SCI->handle_word( FALSE ); } ; +Word : TRUETOK { $$ = SCI->handle_word( TRUETOK ); } ; +Word : FALSETOK { $$ = SCI->handle_word( FALSETOK ); } ; Word : LESS { $$ = SCI->handle_word( LESS ); } ; Word : MORE { $$ = SCI->handle_word( MORE ); } ; Word : LESS_EQUAL { $$ = SCI->handle_word( LESS_EQUAL ); } ;