23 #include "llvm/ADT/ArrayRef.h" 24 #include "llvm/ADT/StringSet.h" 25 #include "llvm/MC/MCParser/MCAsmParser.h" 26 using namespace clang;
32 Expr *ExprUnderCast =
nullptr;
36 ParentsToUpdate.push_back(Parent);
37 if (
auto *ParenE = dyn_cast<ParenExpr>(Parent)) {
38 Parent = ParenE->getSubExpr();
42 Expr *Child =
nullptr;
49 if (
auto *CastE = dyn_cast<CastExpr>(Child))
50 if (CastE->getCastKind() == CK_LValueToRValue) {
51 ExprUnderCast = CastE->getSubExpr();
60 assert(ExprUnderCast &&
61 "Should be reachable only if LValueToRValue cast was found!");
63 for (
Expr *E : ParentsToUpdate)
114 for (
unsigned p = 0, e = AsmStrPieces.size();
p != e; ++
p) {
131 if (!Func->
hasAttr<NakedAttr>())
135 WorkList.push_back(E);
136 while (WorkList.size()) {
137 Expr *E = WorkList.pop_back_val();
138 if (isa<CXXThisExpr>(E)) {
140 S.
Diag(Func->
getAttr<NakedAttr>()->getLocation(), diag::note_attribute);
144 if (isa<ParmVarDecl>(DRE->getDecl())) {
145 S.
Diag(DRE->getBeginLoc(), diag::err_asm_naked_parm_ref);
146 S.
Diag(Func->
getAttr<NakedAttr>()->getLocation(), diag::note_attribute);
151 if (
Expr *E = dyn_cast_or_null<Expr>(Child))
152 WorkList.push_back(E);
162 bool is_input_expr) {
168 } EType = ExprSafeType;
173 EType = ExprBitfield;
175 EType = ExprVectorElt;
177 EType = ExprGlobalRegVar;
179 if (EType != ExprSafeType) {
180 S.
Diag(E->
getBeginLoc(), diag::err_asm_non_addr_value_in_memory_constraint)
194 if (
const DeclRefExpr *AsmDeclRef = dyn_cast<DeclRefExpr>(Expression)) {
196 const VarDecl *Variable = dyn_cast<
VarDecl>(AsmDeclRef->getDecl());
198 if (AsmLabelAttr *
Attr = Variable->
getAttr<AsmLabelAttr>())
214 llvm::StringSet<> InOutVars;
217 for (
unsigned int i = 0;
i < Exprs.size() - NumLabels; ++
i) {
218 StringRef Constraint = Constraints[
i]->
getString();
222 InOutVars.insert(InOutReg);
226 for (
int i = 0;
i < NumClobbers; ++
i) {
230 if (Clobber ==
"cc" || Clobber ==
"memory")
234 if (InOutVars.count(Clobber))
235 return Clobbers[
i]->getBeginLoc();
241 bool IsVolatile,
unsigned NumOutputs,
247 unsigned NumClobbers = clobbers.size();
258 for (
unsigned i = 0;
i != NumOutputs;
i++) {
262 StringRef OutputName;
269 diag::err_asm_invalid_output_constraint)
272 GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
273 NumInputs, Names, Constraints, Exprs.data(), AsmString,
274 NumClobbers, Clobbers, NumLabels, RParenLoc);
277 ExprResult ER = CheckPlaceholderExpr(Exprs[i]);
283 Expr *OutputExpr = Exprs[
i];
290 if (Info.allowsMemory() &&
294 OutputConstraintInfos.push_back(Info);
317 if (RequireCompleteType(OutputExpr->
getBeginLoc(), Exprs[
i]->getType(),
318 diag::err_dereference_incomplete_type))
323 diag::err_asm_invalid_lvalue_in_output)
330 targetDiag(OutputExpr->
getBeginLoc(), diag::err_asm_invalid_output_size)
331 << Info.getConstraintStr();
333 GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
334 NumInputs, Names, Constraints, Exprs.data(), AsmString,
335 NumClobbers, Clobbers, NumLabels, RParenLoc);
341 for (
unsigned i = NumOutputs, e = NumOutputs + NumInputs;
i != e;
i++) {
352 targetDiag(Literal->
getBeginLoc(), diag::err_asm_invalid_input_constraint)
355 GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
356 NumInputs, Names, Constraints, Exprs.data(), AsmString,
357 NumClobbers, Clobbers, NumLabels, RParenLoc);
360 ExprResult ER = CheckPlaceholderExpr(Exprs[i]);
365 Expr *InputExpr = Exprs[
i];
372 if (Info.allowsMemory() &&
377 if (Info.allowsMemory() && !Info.allowsRegister()) {
380 diag::err_asm_invalid_lvalue_in_input)
381 << Info.getConstraintStr()
383 }
else if (Info.requiresImmediateConstant() && !Info.allowsRegister()) {
389 llvm::APSInt IntResult;
392 if (!Info.isValidAsmImmediate(IntResult))
394 diag::err_invalid_asm_value_for_constraint)
395 << IntResult.toString(10)
396 << Info.getConstraintStr()
402 ExprResult Result = DefaultFunctionArrayLvalueConversion(Exprs[i]);
406 Exprs[
i] = Result.
get();
409 if (Info.allowsRegister()) {
413 << InputExpr->
getType() << Info.getConstraintStr()
418 InputConstraintInfos.push_back(Info);
420 const Type *Ty = Exprs[
i]->getType().getTypePtr();
424 if (!Ty->
isVoidType() || !Info.allowsMemory())
425 if (RequireCompleteType(InputExpr->
getBeginLoc(), Exprs[
i]->getType(),
426 diag::err_dereference_incomplete_type))
433 targetDiag(InputExpr->
getBeginLoc(), diag::err_asm_invalid_input_size)
434 << Info.getConstraintStr());
438 for (
unsigned i = 0;
i != NumClobbers;
i++) {
442 StringRef Clobber = Literal->
getString();
445 targetDiag(Literal->
getBeginLoc(), diag::err_asm_unknown_register_name)
448 GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
449 NumInputs, Names, Constraints, Exprs.data(), AsmString,
450 NumClobbers, Clobbers, NumLabels, RParenLoc);
455 new (Context)
GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
456 NumInputs, Names, Constraints, Exprs.data(),
457 AsmString, NumClobbers, Clobbers, NumLabels,
464 targetDiag(getLocationOfStringLiteralByte(AsmString, DiagOffs), DiagID)
470 for (
unsigned i = 0, e = Pieces.size();
i != e; ++
i) {
482 if (ConstraintIdx >= NumOperands) {
485 for (
unsigned Cnt = ConstraintIdx - NumOperands; I != E; ++I)
486 if (OutputConstraintInfos[I].isReadWrite() && Cnt-- == 0) {
491 assert(I != E &&
"Invalid operand number should have been caught in " 492 " AnalyzeAsmString");
497 const Type *Ty = Exprs[ConstraintIdx]->getType().getTypePtr();
502 std::string SuggestedModifier;
505 SuggestedModifier)) {
506 targetDiag(Exprs[ConstraintIdx]->getBeginLoc(),
507 diag::warn_asm_mismatched_size_modifier);
509 if (!SuggestedModifier.empty()) {
511 diag::note_asm_missing_constraint_modifier)
512 << SuggestedModifier;
513 SuggestedModifier =
"%" + SuggestedModifier + Piece.
getString();
520 unsigned NumAlternatives = ~0U;
521 for (
unsigned i = 0, e = OutputConstraintInfos.size();
i != e; ++
i) {
524 unsigned AltCount = ConstraintStr.count(
',') + 1;
525 if (NumAlternatives == ~0U) {
526 NumAlternatives = AltCount;
527 }
else if (NumAlternatives != AltCount) {
529 diag::err_asm_unexpected_constraint_alternatives)
530 << NumAlternatives << AltCount;
536 for (
unsigned i = 0, e = InputConstraintInfos.size();
i != e; ++
i) {
539 unsigned AltCount = ConstraintStr.count(
',') + 1;
540 if (NumAlternatives == ~0U) {
541 NumAlternatives = AltCount;
542 }
else if (NumAlternatives != AltCount) {
544 diag::err_asm_unexpected_constraint_alternatives)
545 << NumAlternatives << AltCount;
555 unsigned InputOpNo =
i+NumOutputs;
556 Expr *OutputExpr = Exprs[TiedTo];
557 Expr *InputExpr = Exprs[InputOpNo];
560 assert(TiedTo < InputMatchedToOutput.size() &&
"TiedTo value out of range");
561 if (InputMatchedToOutput[TiedTo] != ~0U) {
563 diag::err_asm_input_duplicate_match)
566 diag::note_asm_input_duplicate_first)
570 InputMatchedToOutput[TiedTo] =
i;
583 AD_Int, AD_FP, AD_Other
584 } InputDomain, OutputDomain;
587 InputDomain = AD_Int;
591 InputDomain = AD_Other;
594 OutputDomain = AD_Int;
596 OutputDomain = AD_FP;
598 OutputDomain = AD_Other;
608 if (OutSize == InSize && InputDomain == OutputDomain &&
609 InputDomain != AD_Other)
615 bool SmallerValueMentioned =
false;
623 SmallerValueMentioned |= InSize < OutSize;
628 SmallerValueMentioned |= OutSize < InSize;
634 if (!SmallerValueMentioned && InputDomain != AD_Other &&
635 OutputConstraintInfos[TiedTo].allowsRegister())
642 if (InputDomain == AD_Int && OutputDomain == AD_Int &&
646 (OutTy->
isBooleanType() ? CK_IntegralToBoolean : CK_IntegralCast);
647 InputExpr = ImpCastExprToType(InputExpr, OutTy, castKind).get();
648 Exprs[InputOpNo] = InputExpr;
653 targetDiag(InputExpr->
getBeginLoc(), diag::err_asm_tying_incompatible_types)
665 targetDiag(ConstraintLoc, diag::error_inoutput_conflict_with_clobber);
668 typedef std::pair<StringRef , Expr *> NamedOperand;
670 for (
unsigned i = 0, e = NumOutputs + NumInputs + NumLabels;
i != e; ++
i)
672 NamedOperandList.emplace_back(
673 std::make_pair(Names[i]->
getName(), Exprs[i]));
675 std::stable_sort(NamedOperandList.begin(), NamedOperandList.end(),
676 [](
const NamedOperand &LHS,
const NamedOperand &RHS) {
677 return LHS.first < RHS.first;
681 std::adjacent_find(begin(NamedOperandList), end(NamedOperandList),
682 [](
const NamedOperand &LHS,
const NamedOperand &RHS) {
683 return LHS.first == RHS.first;
685 if (Found != NamedOperandList.end()) {
686 Diag((Found + 1)->second->getBeginLoc(),
687 diag::error_duplicate_asm_operand_name)
688 << (Found + 1)->first;
689 Diag(Found->second->getBeginLoc(), diag::note_duplicate_asm_operand_name)
694 setFunctionHasBranchIntoScope();
699 llvm::InlineAsmIdentifierInfo &Info) {
703 return Info.setLabel(Res);
706 return Info.setEnum(Eval.
Val.
getInt().getSExtValue());
707 return Info.setLabel(Res);
710 unsigned Type = Size;
713 bool IsGlobalLV =
false;
716 Info.setVar(Res, IsGlobalLV, Size, Type);
722 bool IsUnevaluatedContext) {
724 if (IsUnevaluatedContext)
725 PushExpressionEvaluationContext(
726 ExpressionEvaluationContext::UnevaluatedAbstract,
727 ReuseLambdaContextDecl);
729 ExprResult Result = ActOnIdExpression(getCurScope(), SS, TemplateKWLoc, Id,
735 if (IsUnevaluatedContext)
736 PopExpressionEvaluationContext();
738 if (!Result.
isUsable())
return Result;
740 Result = CheckPlaceholderExpr(Result.
get());
741 if (!Result.
isUsable())
return Result;
759 if (RequireCompleteExprType(Result.
get(), diag::err_asm_incomplete_type)) {
770 Member.split(Members,
".");
775 if (getLangOpts().
CPlusPlus && Base.equals(
"this")) {
776 if (
const Type *PT = getCurrentThisType().getTypePtrOrNull())
777 FoundDecl = PT->getPointeeType()->getAsTagDecl();
788 for (StringRef NextMember : Members) {
790 if (
VarDecl *VD = dyn_cast<VarDecl>(FoundDecl))
793 MarkAnyDeclReferenced(TD->getLocation(), TD,
false);
795 QualType QT = TD->getUnderlyingType();
799 }
else if (
TypeDecl *TD = dyn_cast<TypeDecl>(FoundDecl))
801 else if (
FieldDecl *TD = dyn_cast<FieldDecl>(FoundDecl))
806 if (RequireCompleteType(AsmLoc,
QualType(RT, 0),
807 diag::err_asm_incomplete_type))
813 if (!LookupQualifiedName(FieldResult, RT->
getDecl()))
816 if (!FieldResult.isSingleResult())
818 FoundDecl = FieldResult.getFoundDecl();
846 nullptr, NameInfo,
nullptr);
857 if (!LookupQualifiedName(FieldResult, RT->
getDecl()))
878 unsigned NumOutputs,
unsigned NumInputs,
883 bool IsSimple = (NumOutputs != 0 || NumInputs != 0);
884 setFunctionHasBranchProtectedScope();
886 new (Context)
MSAsmStmt(Context, AsmLoc, LBraceLoc, IsSimple,
887 true, AsmToks, NumOutputs, NumInputs,
888 Constraints, Exprs, AsmString,
896 LabelDecl*
Label = LookupOrCreateLabel(PP.getIdentifierInfo(ExternalLabelName),
904 std::string InternalName;
905 llvm::raw_string_ostream OS(InternalName);
911 OS <<
"__MSASMLABEL_.${:uid}__";
912 for (
char C : ExternalLabelName) {
This represents a GCC inline-assembly statement extension.
Represents a function declaration or definition.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
unsigned getNumInputs() const
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
void FillInlineAsmIdentifierInfo(Expr *Res, llvm::InlineAsmIdentifierInfo &Info)
const ASTRecordLayout & getASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class) D...
Stmt - This represents one statement.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
bool isRealFloatingType() const
Floating point categories.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
unsigned getNumOutputs() const
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
unsigned getFieldIndex() const
Returns the index of this field within its record, as appropriate for passing to ASTRecordLayout::get...
static void emitAndFixInvalidAsmCastLValue(const Expr *LVal, Expr *BadArgument, Sema &S)
Emit a warning about usage of "noop"-like casts for lvalues (GNU extension) and fix the argument with...
The base class of the type hierarchy.
bool validateInputConstraint(MutableArrayRef< ConstraintInfo > OutputConstraints, ConstraintInfo &info) const
const TargetInfo & getTargetInfo() const
void setInputExpr(unsigned i, Expr *E)
Represents a variable declaration or definition.
ActionResult< Stmt * > StmtResult
const T * getAs() const
Member-template getAs<specific type>'.
unsigned AnalyzeAsmString(SmallVectorImpl< AsmStringPiece > &Pieces, const ASTContext &C, unsigned &DiagOffs) const
AnalyzeAsmString - Analyze the asm string of the current asm, decomposing it into pieces...
Defines the clang::Expr interface and subclasses for C++ expressions.
static bool checkExprMemoryConstraintCompat(Sema &S, Expr *E, TargetInfo::ConstraintInfo &Info, bool is_input_expr)
Returns true if given expression is not compatible with inline assembly's memory constraint; false ot...
One of these records is kept for each identifier that is lexed.
SourceLocation getBegin() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
StringRef getNormalizedGCCRegisterName(StringRef Name, bool ReturnCanonical=false) const
Returns the "normalized" GCC register name.
virtual bool validateConstraintModifier(StringRef, char, unsigned, std::string &) const
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a member of a struct/union/class.
CharSourceRange getRange() const
void setName(DeclarationName N)
setName - Sets the embedded declaration name.
static bool isOperandMentioned(unsigned OpNo, ArrayRef< GCCAsmStmt::AsmStringPiece > AsmStrPieces)
isOperandMentioned - Return true if the specified operand # is mentioned anywhere in the decomposed a...
LabelDecl * GetOrCreateMSAsmLabel(StringRef ExternalLabelName, SourceLocation Location, bool AlwaysCreate)
Represents a C++ unqualified-id that has been parsed.
Represents the results of name lookup.
bool refersToBitField() const
Returns true if this expression is a gl-value that potentially refers to a bit-field.
CharUnits - This is an opaque type for sizes expressed in character units.
APValue Val
Val - This is the value the expression can be folded to.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Represents a declaration of a type.
virtual StringRef getConstraintRegister(StringRef Constraint, StringRef Expression) const
Extracts a register from the passed constraint (if it is a single-register constraint) and the asm la...
Expr * getOutputExpr(unsigned i)
Represents a C++ nested-name-specifier or a global scope specifier.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
const LangOptions & getLangOpts() const
bool isTypeDependent() const
isTypeDependent - Determines whether this expression is type-dependent (C++ [temp.dep.expr]), which means that its type could change from one template instantiation to the next.
virtual bool isValidGCCRegisterName(StringRef Name) const
Returns whether the passed in string is a valid register name according to GCC.
Expr * IgnoreImpCasts() LLVM_READONLY
Skip past any implicit casts which might surround this expression until reaching a fixed point...
ExprResult LookupInlineAsmIdentifier(CXXScopeSpec &SS, SourceLocation TemplateKWLoc, UnqualifiedId &Id, bool IsUnevaluatedContext)
Sema - This implements semantic analysis and AST building for C.
StringRef getString() const
bool isValidClobber(StringRef Name) const
Returns whether the passed in string is a valid clobber in an inline asm statement.
CastKind
CastKind - The kind of operation required for a conversion.
bool EvaluateAsLValue(EvalResult &Result, const ASTContext &Ctx, bool InConstantContext=false) const
EvaluateAsLValue - Evaluate an expression to see if we can fold it to an lvalue with link time known ...
unsigned getOperandNo() const
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
static bool CheckNakedParmReference(Expr *E, Sema &S)
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
Exposes information about the current target.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
AsmStringPiece - this is part of a decomposed asm string specification (for use with the AnalyzeAsmSt...
Defines the clang::Preprocessor interface.
static CXXDependentScopeMemberExpr * Create(const ASTContext &Ctx, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs)
Defines the clang::TypeLoc interface and its subclasses.
void setValueKind(ExprValueKind Cat)
setValueKind - Set the value kind produced by this expression.
ActionResult< CXXBaseSpecifier * > BaseResult
This represents a Microsoft inline-assembly statement extension.
void setLocation(SourceLocation L)
RecordDecl * getDecl() const
uint64_t getFieldOffset(unsigned FieldNo) const
getFieldOffset - Get the offset of the given field index, in bits.
bool EvaluateAsRValue(EvalResult &Result, const ASTContext &Ctx, bool InConstantContext=false) const
EvaluateAsRValue - Return true if this is a constant which we can fold to an rvalue using any crazy t...
ActionResult - This structure is used while parsing/acting on expressions, stmts, etc...
bool isGlobalLValue() const
Encodes a location in the source.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
static StringRef extractRegisterName(const Expr *Expression, const TargetInfo &Target)
ExprResult LookupInlineAsmVarDeclField(Expr *RefExpr, StringRef Member, SourceLocation AsmLoc)
StmtResult ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple, bool IsVolatile, unsigned NumOutputs, unsigned NumInputs, IdentifierInfo **Names, MultiExprArg Constraints, MultiExprArg Exprs, Expr *AsmString, MultiExprArg Clobbers, unsigned NumLabels, SourceLocation RParenLoc)
Represents the declaration of a label.
static void removeLValueToRValueCast(Expr *E)
Remove the upper-level LValueToRValue cast from an expression.
const std::string & getString() const
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
bool validateOutputConstraint(ConstraintInfo &Info) const
bool isValueDependent() const
isValueDependent - Determines whether this expression is value-dependent (C++ [temp.dep.constexpr]).
SourceLocation getBeginLoc() const LLVM_READONLY
bool isMSAsmLabel() const
bool LookupInlineAsmField(StringRef Base, StringRef Member, unsigned &Offset, SourceLocation AsmLoc)
bool isLValue() const
isLValue - True if this expression is an "l-value" according to the rules of the current language...
isModifiableLvalueResult isModifiableLvalue(ASTContext &Ctx, SourceLocation *Loc=nullptr) const
isModifiableLvalue - C99 6.3.2.1: an lvalue that does not have array type, does not have an incomplet...
bool refersToVectorElement() const
Returns whether this expression refers to a vector element.
Expr * getInputExpr(unsigned i)
StringRef getName() const
Return the actual identifier string.
Base class for declarations which introduce a typedef-name.
Dataflow Directional Tag Classes.
bool isValid() const
Return true if this is a valid SourceLocation object.
EvalResult is a struct with detailed info about an evaluated expression.
static std::string getName(const CallEvent &Call)
StmtResult ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc, ArrayRef< Token > AsmToks, StringRef AsmString, unsigned NumOutputs, unsigned NumInputs, ArrayRef< StringRef > Constraints, ArrayRef< StringRef > Clobbers, ArrayRef< Expr *> Exprs, SourceLocation EndLoc)
Represents a field injected from an anonymous union/struct into the parent scope. ...
bool isBooleanType() const
char getModifier() const
getModifier - Get the modifier for this operand, if present.
bool hasTiedOperand() const
Return true if this input operand is a matching constraint that ties it to an output operand...
bool toIntegralConstant(APSInt &Result, QualType SrcTy, const ASTContext &Ctx) const
Try to convert this value to an integral constant.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
const std::string & getConstraintStr() const
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
bool isFunctionType() const
unsigned getTiedOperand() const
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
void markUsed(ASTContext &C)
Mark the declaration used, in the sense of odr-use.
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
bool isIncompleteType(NamedDecl **Def=nullptr) const
Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types...
void setLoc(SourceLocation L)
setLoc - Sets the main location of the declaration name.
CharUnits toCharUnitsFromBits(int64_t BitSize) const
Convert a size in bits to a size in characters.
bool refersToGlobalRegisterVar() const
Returns whether this expression refers to a global register variable.
ActionResult< Expr * > ExprResult
virtual bool validateOutputSize(StringRef, unsigned) const
static bool CheckAsmLValue(Expr *E, Sema &S)
CheckAsmLValue - GNU C has an extremely ugly extension whereby they silently ignore "noop" casts in p...
void setMSAsmLabel(StringRef Name)
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
static FixItHint CreateReplacement(CharSourceRange RemoveRange, StringRef Code)
Create a code modification hint that replaces the given source range with the given code string...
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
StringLiteral - This represents a string literal expression, e.g.
Defines the clang::TargetInfo interface.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isEvaluatable(const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects) const
isEvaluatable - Call EvaluateAsRValue to see if this expression can be constant folded without side-e...
A reference to a declared variable, function, enum, etc.
bool isPointerType() const
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
void setMSAsmLabelResolved()
virtual bool validateInputSize(StringRef, unsigned) const
This represents a decl that may have a name.
Expr * IgnoreParenNoopCasts(const ASTContext &Ctx) LLVM_READONLY
Skip past any parenthese and casts which do not change the value (including ptr->int casts of the sam...
static SourceLocation getClobberConflictLocation(MultiExprArg Exprs, StringLiteral **Constraints, StringLiteral **Clobbers, int NumClobbers, unsigned NumLabels, const TargetInfo &Target, ASTContext &Cont)
Attr - This represents one attribute.