MIR Parser: Simplify the token's string value handling.
authorAlex Lorenz <arphaman@gmail.com>
Thu, 6 Aug 2015 23:17:42 +0000 (23:17 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Thu, 6 Aug 2015 23:17:42 +0000 (23:17 +0000)
commit263d80f920133d4fe03df290bfdb333cd14bda3f
tree7f48946c0f5e5ff26fdf08f58dbaa570a89504a2
parent7515d33b6c9fbee5ae22f9cba817d19cfae51cd1
MIR Parser: Simplify the token's string value handling.

This commit removes the 'StringOffset' and 'HasStringValue' fields from the
MIToken struct and simplifies the 'stringValue' method which now returns
the new 'StringValue' field.

This commit also adopts a different way of initializing the lexed tokens -
instead of constructing a new MIToken instance, the lexer resets the old token
using the new 'reset' method and sets its attributes using the new
'setStringValue', 'setOwnedStringValue', and 'setIntegerValue' methods.

Reviewers: Sean Silva

Differential Revision: http://reviews.llvm.org/D11792

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244295 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MIRParser/MILexer.cpp
lib/CodeGen/MIRParser/MILexer.h
lib/CodeGen/MIRParser/MIParser.cpp