| 587 | } |
| 588 | |
| 589 | bool StringRef::getAsDouble(double &Result, bool AllowInexact) const { |
| 590 | APFloat F(0.0); |
| 591 | auto StatusOrErr = F.convertFromString(*this, APFloat::rmNearestTiesToEven); |
| 592 | if (errorToBool(StatusOrErr.takeError())) |
| 593 | return true; |
| 594 | |
| 595 | APFloat::opStatus Status = *StatusOrErr; |
| 596 | if (Status != APFloat::opOK) { |
| 597 | if (!AllowInexact || !(Status & APFloat::opInexact)) |
| 598 | return true; |
| 599 | } |
| 600 | |
| 601 | Result = F.convertToDouble(); |
| 602 | return false; |
| 603 | } |
| 604 | |
| 605 | // Implementation of StringRef hashing. |
| 606 | hash_code llvm::hash_value(StringRef S) { |
nothing calls this directly
no test coverage detected