&& "fp and int modifiers should not be used simultaneously")(static_cast <bool> (!(hasFPModifiers() && hasIntModifiers()) && "fp and int modifiers should not be used simultaneously") ? void (0) : __assert_fail ("!(hasFPModifiers() && hasIntModifiers()) && \"fp and int modifiers should not be used simultaneously\"", "/build/llvm-toolchain-snapshot-7~svn325118/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp", 115, __extension__ __PRETTY_FUNCTION__));

// Construct a twine to print \p Val as an unsigned hexadecimal integer.

385

static Twine utohexstr(const uint64_t &Val) {

386

Child LHS, RHS;

387

LHS.uHex = &Val;

388

RHS.twine = nullptr;

389

return Twine(LHS, UHexKind, RHS, EmptyKind);

390

}

391

392

/// @}

393

/// @name Predicate Operations

394

/// @{

395

396

/// Check if this twine is trivially empty; a false return value does not

397

/// necessarily mean the twine is empty.

398

bool isTriviallyEmpty() const {

399

return isNullary();

400

}

401

402

/// Return true if this twine can be dynamically accessed as a single

403

/// StringRef value with getSingleStringRef().

404

bool isSingleStringRef() const {

405

if (getRHSKind() != EmptyKind) returnfalse;

406

407

switch (getLHSKind()) {

408

case EmptyKind:

409

case CStringKind:

410

case StdStringKind:

411

case StringRefKind:

412

case SmallStringKind:

413

returntrue;

414

default:

415

returnfalse;

416

}

417

}

418

419

/// @}

420

/// @name String Operations

421

/// @{

422

423

Twine concat(const Twine &Suffix) const;

424

425

/// @}

426

/// @name Output & Conversion.

427

/// @{

428

429

/// Return the twine contents as a std::string.

430

std::string str() const;

431

432

/// Append the concatenated string into the given SmallString or SmallVector.

433

void toVector(SmallVectorImpl<char> &Out) const;

434

435

/// This returns the twine as a single StringRef. This method is only valid

436

/// if isSingleStringRef() is true.

437

StringRef getSingleStringRef() const {

438

assert(isSingleStringRef() &&"This cannot be had as a single stringref!")(static_cast <bool> (isSingleStringRef() &&"This cannot be had as a single stringref!") ? void (0) : __assert_fail ("isSingleStringRef() &&\"This cannot be had as a single stringref!\"", "/build/llvm-toolchain-snapshot-7~svn325118/include/llvm/ADT/Twine.h", 438, __extension__ __PRETTY_FUNCTION__));

439

switch (getLHSKind()) {

440

default: llvm_unreachable("Out of sync with isSingleStringRef")::llvm::llvm_unreachable_internal("Out of sync with isSingleStringRef", "/build/llvm-toolchain-snapshot-7~svn325118/include/llvm/ADT/Twine.h", 440);

441

case EmptyKind: return StringRef();

442

case CStringKind: return StringRef(LHS.cString);

443

case StdStringKind: return StringRef(*LHS.stdString);

444

case StringRefKind: return *LHS.stringRef;

445

case SmallStringKind:

446

return StringRef(LHS.smallString->data(), LHS.smallString->size());

447

}

448

}

449

450

/// This returns the twine as a single StringRef if it can be

451

/// represented as such. Otherwise the twine is written into the given

452

/// SmallVector and a StringRef to the SmallVector's data is returned.

453

StringRef toStringRef(SmallVectorImpl<char> &Out) const {

454

if (isSingleStringRef())

455

return getSingleStringRef();

456

toVector(Out);

457

return StringRef(Out.data(), Out.size());

458

}

459

460

/// This returns the twine as a single null terminated StringRef if it

461

/// can be represented as such. Otherwise the twine is written into the

462

/// given SmallVector and a StringRef to the SmallVector's data is returned.

463

///

464

/// The returned StringRef's size does not include the null terminator.