LLVM: include/llvm/Remarks/HotnessThresholdParser.h Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15#ifndef LLVM_REMARKS_HOTNESSTHRESHOLDPARSER_H

16#define LLVM_REMARKS_HOTNESSTHRESHOLDPARSER_H

17

20#include

21

22namespace llvm {

24

25

26

27

28

29

30

31

33 if (Arg == "auto")

34 return std::nullopt;

35

36 int64_t Val;

39 "Not an integer: %s", Arg.data());

40

41

42 return Val < 0 ? 0 : Val;

43}

44

45

47public:

49

51 std::optional<uint64_t> &V) {

53 if (!ResultOrErr)

54 return O.error("Invalid argument '" + Arg +

55 "', only integer or 'auto' is supported.");

56

57 V = *ResultOrErr;

58 return false;

59 }

60};

61

62}

63}

64#endif

Tagged union holding either a T or a Error.

StringRef - Represent a constant reference to a string, i.e.

bool getAsInteger(unsigned Radix, T &Result) const

Parse the current string as an integer of the specified radix.

constexpr const char * data() const

data - Get a pointer to the start of the string (which may not be null terminated).

This namespace contains all of the command line option processing machinery.

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI std::error_code inconvertibleErrorCode()

The value returned by this function can be returned from convertToErrorCode for Error values where no...

Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)

Create formatted StringError object.

Implement std::hash so that hash_code can be used in STL containers.