[InstCombine] Signed saturation patterns
[llvm-complete.git] / include / llvm / WindowsResource / ResourceScriptToken.h
blob254121cd318a3845911d5e04bf22fbbd60e6cb46
1 //===-- ResourceScriptToken.h -----------------------------------*- C++-*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===---------------------------------------------------------------------===//
8 //
9 // This declares the .rc script tokens.
10 // The list of available tokens is located at ResourceScriptTokenList.h.
12 // Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa380599(v=vs.85).aspx
14 //===---------------------------------------------------------------------===//
16 #ifndef LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_SCRIPTTOKEN_H
17 #define LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_SCRIPTTOKEN_H
19 #include "llvm/ADT/StringRef.h"
21 namespace llvm {
23 // A definition of a single resource script token. Each token has its kind
24 // (declared in ResourceScriptTokenList) and holds a value - a reference
25 // representation of the token.
26 // RCToken does not claim ownership on its value. A memory buffer containing
27 // the token value should be stored in a safe place and cannot be freed
28 // nor reallocated.
29 class RCToken {
30 public:
31 enum class Kind {
32 #define TOKEN(Name) Name,
33 #define SHORT_TOKEN(Name, Ch) Name,
34 #include "ResourceScriptTokenList.h"
35 #undef TOKEN
36 #undef SHORT_TOKEN
39 RCToken(RCToken::Kind RCTokenKind, StringRef Value);
41 // Get an integer value of the integer token.
42 uint32_t intValue() const;
43 bool isLongInt() const;
45 StringRef value() const;
46 Kind kind() const;
48 // Check if a token describes a binary operator.
49 bool isBinaryOp() const;
51 private:
52 Kind TokenKind;
53 StringRef TokenValue;
56 } // namespace llvm
58 #endif