For PR950:
authorReid Spencer <rspencer@reidspencer.com>
Sun, 31 Dec 2006 05:40:12 +0000 (05:40 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 31 Dec 2006 05:40:12 +0000 (05:40 +0000)
commite1553cc95601f3d5c5c807f482085857dd7937a8
treeb128cb594fde87225bfd7e6afd8f2487517785cd
parent79e21d338c60b4b5a5746fc45e37ea0310606aee
For PR950:
Major reorganization. This patch introduces the signedness changes for
the new integer types (i8, i16, i32, i64) which replace the old signed
versions (ubyte, sbyte, ushort, short, etc). This patch also implements
the function type parameter attributes feature. Together these conspired
to introduce new reduce/reduce errors into the grammar. Consequently, it
was necessary to introduce a new keyword into the grammar in order to
disambiguate. Without this, yacc would make incorrect shift/reduce and
reduce/reduce decisions and fail to parse the intended assembly.

Changes in assembly:

1. The "implementation" keyword is superfluous but still supported. You
   can use it as a sentry which will ensure there are no remaining up
   reference types. However, this is optional as those checks are also
   performed elsewhere.

2. Parameter attributes are now implemented using an at sign to
   indicate the attribute. The attributes are placed after the type
   in a function declaration or after the argument value in a function
   call. For example:
      i8 @sext %myfunc(i16 @zext)
      call i8 @sext %myfunc(i16 @zext %someVal)
   The facility is available for supporting additional attributes and
   they can be combined using the @(attr1,attr2,attr3) syntax. Right
   now  the only two supported are @sext and @zext

3. Functions must now be defined with the "define" keyword which is
   analagous to the "declare" keyword for function declarations. The
   introduction of this keyword disambiguates situations where a
   named result type is confused with a new type or gvar definition.
   For example:
      %MyType = type i16
      %MyType %func(%MyType) { ... }
   With the introduction of optional parameter attributes between
   the function name and the function result type, yacc will pick
   the wrong rule to reduce unless it is disambiguated with "define"
   before the function definition, as in:
      define %MyType @zext %func(%MyType %someArg) { ... }

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32781 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AsmParser/Lexer.l
lib/AsmParser/llvmAsmParser.y