diff options
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 4882f536d52..89f47f980c9 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -3437,6 +3437,18 @@ bool Expr::refersToVectorElement() const { return false; } +bool Expr::refersToGlobalRegisterVar() const { + const Expr *E = this->IgnoreParenImpCasts(); + + if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) + if (const auto *VD = dyn_cast<VarDecl>(DRE->getDecl())) + if (VD->getStorageClass() == SC_Register && + VD->hasAttr<AsmLabelAttr>() && !VD->isLocalVarDecl()) + return true; + + return false; +} + /// isArrow - Return true if the base expression is a pointer to vector, /// return false if the base expression is a vector. bool ExtVectorElementExpr::isArrow() const { |

