llvm.org GIT mirror llvm / 03949c9
remove some confused code that used strtoull git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94128 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
1 changed file(s) with 5 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
1313 #include "AsmLexer.h"
1414 #include "llvm/Support/SMLoc.h"
1515 #include "llvm/Support/MemoryBuffer.h"
16 #include "llvm/Config/config.h" // for strtoull.
1716 #include "llvm/MC/MCAsmInfo.h"
1817 #include
1918 #include
162161 // Requires at least one hex digit.
163162 if (CurPtr == NumStart)
164163 return ReturnError(CurPtr-2, "Invalid hexadecimal number");
165
166 errno = 0;
167 if (errno == EINVAL)
164
165 unsigned long long Result;
166 if (StringRef(TokStart, CurPtr - TokStart).getAsInteger(0, Result))
168167 return ReturnError(CurPtr-2, "Invalid hexadecimal number");
169 if (errno == ERANGE) {
170 errno = 0;
171 if (errno == EINVAL)
172 return ReturnError(CurPtr-2, "Invalid hexadecimal number");
173 if (errno == ERANGE)
174 return ReturnError(CurPtr-2, "Hexadecimal number out of range");
175 }
168
176169 return AsmToken(AsmToken::Integer, StringRef(TokStart, CurPtr - TokStart),
177 (int64_t) strtoull(NumStart, 0, 16));
170 (int64_t)Result);
178171 }
179172
180173 // Must be an octal number, it starts with 0.