diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-13 02:33:34 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-13 02:33:34 +0000 |
commit | 689ad6ef3fd2e89394f1e8860dfebfe56b73c3da (patch) | |
tree | 8f87f91f4fabaf5a9ce4c06a2896b634cd162cd3 /lib/AsmParser | |
parent | 28865062c1ef60e47f0ac23a5ebc22eaf0d1b184 (diff) | |
download | external_llvm-689ad6ef3fd2e89394f1e8860dfebfe56b73c3da.zip external_llvm-689ad6ef3fd2e89394f1e8860dfebfe56b73c3da.tar.gz external_llvm-689ad6ef3fd2e89394f1e8860dfebfe56b73c3da.tar.bz2 |
Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef.
- Patch by Erick Tryzelaar, with some edits (and a bug fix) from me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r-- | lib/AsmParser/LLLexer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp index a6e6344..c5e6424 100644 --- a/lib/AsmParser/LLLexer.cpp +++ b/lib/AsmParser/LLLexer.cpp @@ -659,7 +659,7 @@ lltok::Kind LLLexer::LexIdentifier() { TokStart[1] == '0' && TokStart[2] == 'x' && isxdigit(TokStart[3])) { int len = CurPtr-TokStart-3; uint32_t bits = len * 4; - APInt Tmp(bits, TokStart+3, len, 16); + APInt Tmp(bits, StringRef(TokStart+3, len), 16); uint32_t activeBits = Tmp.getActiveBits(); if (activeBits > 0 && activeBits < bits) Tmp.trunc(activeBits); @@ -785,7 +785,7 @@ lltok::Kind LLLexer::LexDigitOrNegative() { return Lex0x(); unsigned Len = CurPtr-TokStart; uint32_t numBits = ((Len * 64) / 19) + 2; - APInt Tmp(numBits, TokStart, Len, 10); + APInt Tmp(numBits, StringRef(TokStart, Len), 10); if (TokStart[0] == '-') { uint32_t minBits = Tmp.getMinSignedBits(); if (minBits > 0 && minBits < numBits) |