[clang][Interp][NFC] Remove an unnecessary local variable
authorTimm Bäder <tbaeder@redhat.com>
Wed, 5 Oct 2022 04:17:40 +0000 (06:17 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Fri, 14 Oct 2022 11:33:04 +0000 (13:33 +0200)
clang/lib/AST/Interp/ByteCodeExprGen.cpp

index 448bea9..d504ff3 100644 (file)
@@ -1063,7 +1063,6 @@ bool ByteCodeExprGen<Emitter>::VisitUnaryOperator(const UnaryOperator *E) {
 template <class Emitter>
 bool ByteCodeExprGen<Emitter>::VisitDeclRefExpr(const DeclRefExpr *E) {
   const auto *Decl = E->getDecl();
-  bool IsReference = Decl->getType()->isReferenceType();
   bool FoundDecl = false;
 
   if (auto It = Locals.find(Decl); It != Locals.end()) {
@@ -1094,7 +1093,7 @@ bool ByteCodeExprGen<Emitter>::VisitDeclRefExpr(const DeclRefExpr *E) {
   // References are implemented using pointers, so when we get here,
   // we have a pointer to a pointer, which we need to de-reference once.
   if (FoundDecl) {
-    if (IsReference) {
+    if (Decl->getType()->isReferenceType()) {
       if (!this->emitLoadPopPtr(E))
         return false;
     }