MLIR  16.0.0git
Functions
AttributeParser.cpp File Reference
#include "Parser.h"
#include "AsmParserImpl.h"
#include "mlir/AsmParser/AsmParserState.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinDialect.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/DialectResourceBlobManager.h"
#include "mlir/IR/IntegerSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Endian.h"
+ Include dependency graph for AttributeParser.cpp:

Go to the source code of this file.

Functions

static Optional< APInt > buildAttributeAPInt (Type type, bool isNegative, StringRef spelling)
 Construct an APint from a parsed value, a known attribute type and sign. More...
 
static ParseResult parseElementAttrHexValues (Parser &parser, Token tok, std::string &result)
 Parse elements values stored within a hex string. More...
 

Function Documentation

◆ buildAttributeAPInt()

static Optional<APInt> buildAttributeAPInt ( Type  type,
bool  isNegative,
StringRef  spelling 
)
static

Construct an APint from a parsed value, a known attribute type and sign.

Definition at line 354 of file AttributeParser.cpp.

References mlir::Type::getIntOrFloatBitWidth(), mlir::Type::isIndex(), and mlir::Type::isSignedInteger().

Referenced by mlir::detail::Parser::parseDecOrHexAttr().

◆ parseElementAttrHexValues()

static ParseResult parseElementAttrHexValues ( Parser parser,
Token  tok,
std::string &  result 
)
static

Parse elements values stored within a hex string.

On success, the values are stored into 'result'.

Definition at line 446 of file AttributeParser.cpp.

References mlir::detail::Parser::emitError(), mlir::Token::getHexStringValue(), mlir::Token::getLoc(), mlir::success(), and value.