Given a variable declaration of some sort, check it's name and type and
if it looks like any of the key type changes between unsafe and atomic
queues, perform the conversion to change it's type.

@param node
@param name
964844
void processSpecialNodeTypes(NodeWithType<?, Type> node, String name) {
        Type type = node.getType();
        if (node instanceof MethodDeclaration && ("newBufferAndOffset".equals(name) || "nextArrayOffset".equals(name))) {
            node.setType(PrimitiveType.intType());
        } else if (PrimitiveType.longType().equals(type)) {
            switch(name) {
            case "offset":
            case "offsetInNew":
            case "offsetInOld":
            case "lookAheadElementOffset":
                node.setType(PrimitiveType.intType());
            }
        } else if (isRefType(type, "LinkedQueueNode")) {
            node.setType(simpleParametricType("LinkedQueueAtomicNode", "E"));
        } else if (isRefArray(type, "E")) {
            node.setType(atomicRefArrayType((ArrayType) type));
        }
    }
647879
function checkVar(node) {
            const leftNode = (node.id.typeAnnotation) ? node.id.typeAnnotation : node.id;
            const rightNode = node.init;

            if (rightNode) {
                const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, "=");

                if (nonSpacedNode) {
                    report(node, nonSpacedNode);
                }
            }
        }
860595
private void handleTypeAndAttributes(Node node, Map<String, Object> elementMap) {
        // Set type
        if (node.getLocalName() != null) {
            elementMap.put("_type", node.getLocalName());
        }

        // Set the attributes
        if (node.getAttributes() != null) {
            NamedNodeMap attributeMap = node.getAttributes();
            for (int i = 0; i < attributeMap.getLength(); i++) {
                Node attribute = attributeMap.item(i);
                elementMap.put(attribute.getNodeName(), attribute.getNodeValue());
            }
        }
    }
508865
function inferrableVariableVisitor(node) {
            if (!node.id) {
                return;
            }
            reportInferrableType(node, node.id.typeAnnotation, node.init);
        }
998878
public void assignDefault(String name) throws IOException
    {
        if (hasLocalVariable(name))
        {
            TypeMirror t = getLocalType(name);
            if (Typ.isPrimitive(t))
            {
                tconst(t, 0);
            }
            else
            {
                aconst_null();
            }
            tstore(name);
        }
        else
        {
            VariableElement field = El.getField(subClass, name);
            if (field == null)
            {
                throw new IllegalArgumentException("field "+name+" not found");
            }
            aload(0);
            TypeMirror t = field.asType();
            if (Typ.isPrimitive(t))
            {
                tconst(t, 0);
            }
            else
            {
                aconst_null();
            }
            putField(name);
        }
    }
1214318
static void setName(NodeImpl node, String name) {
        int prefixSeparator = name.lastIndexOf(":");
        if (prefixSeparator != -1) {
            String prefix = name.substring(0, prefixSeparator);
            String localName = name.substring(prefixSeparator + 1);
            if (!DocumentImpl.isXMLIdentifier(prefix) || !DocumentImpl.isXMLIdentifier(localName)) {
                throw new DOMException(DOMException.INVALID_CHARACTER_ERR, name);
            }
        } else if (!DocumentImpl.isXMLIdentifier(name)) {
            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, name);
        }

        switch (node.getNodeType()) {
        case ATTRIBUTE_NODE:
            AttrImpl attr = (AttrImpl) node;
            attr.namespaceAware = false;
            attr.localName = name;
            break;

        case ELEMENT_NODE:
            ElementImpl element = (ElementImpl) node;
            element.namespaceAware = false;
            element.localName = name;
            break;

        default:
            throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
                    "Cannot rename nodes of type " + node.getNodeType());
        }
    }
950482
function (name, type, callback) {
        var that = this;
        var performRequest = function () {
            if (!that.HasSparkVariable(name)) {
                callback(null, null, "Variable not found");
                return;
            }

            var token = this.sendMessage("VariableRequest", { name: name });
            var varTransformer = this.transformVariableGenerator(name, callback);
            this.listenFor("VariableValue", null, token, varTransformer, true);
        }.bind(this);

        if (this.hasFnState()) {
            //slight short-circuit, saves ~5 seconds every 100,000 requests...
            performRequest();
        }
        else {
            when(this.ensureWeHaveIntrospectionData())
                .then(
                    performRequest,
                    function (err) { callback(null, null, "Problem requesting variable: " + err);
                });
        }
    }
752863
public boolean recordTypeTransformation(String name, Node expr) {
    if (currentInfo.declareTypeTransformation(name, expr)) {
      populated = true;
      return true;
    } else {
      return false;
    }
  }
124620
function(name, nodes) {
          if (name !== 'declaration') {
            return false;
          }

          if (
              nodes.content[0] &&
              nodes.content[0].content &&
              nodes.content[0].content[0] &&
              nodes.content[0].content[0].type &&
              nodes.content[0].content[0].type === 'variable'
            ) {
            return true;
          }

        }
920313
private boolean isTypeReference(String name) {
        return result.containsKey(name) && !(result.get(name) instanceof GraphQLTypeReference);
    }
774305
protected function checkVariable(DOMNode $node, $tag, $qname)
	{
		// Test whether this variable comes from a previous xsl:param or xsl:variable element
		$this->checkVariableDeclaration($node, $tag, 'xsl:param[@name="' . $qname . '"]');
		$this->checkVariableDeclaration($node, $tag, 'xsl:variable[@name="' . $qname . '"]');
	}
1002012
private void visitForOf(Node node, Node parent) {
    Node variable = node.removeFirstChild();
    Node iterable = node.removeFirstChild();
    Node body = node.removeFirstChild();

    JSType typeParam = unknownType;
    if (addTypes) {
      // TODO(sdh): This is going to be null if the iterable is nullable or unknown. We might want
      // to consider some way of unifying rather than simply looking at the nominal type.
      ObjectType iterableType = iterable.getJSType().autobox().toMaybeObjectType();
      if (iterableType != null) {
        // This will be the unknown type if iterableType is not actually a subtype of Iterable
        typeParam =
            iterableType.getInstantiatedTypeArgument(
                registry.getNativeType(JSTypeNative.ITERABLE_TYPE));
      }
    }
    JSType iteratorType = createGenericType(JSTypeNative.ITERATOR_TYPE, typeParam);
    FunctionType iteratorNextType =
        addTypes
            ? iteratorType.toMaybeObjectType().getPropertyType("next").toMaybeFunctionType()
            : null;
    JSType iIterableResultType = addTypes ? iteratorNextType.getReturnType() : null;

    JSDocInfo varJSDocInfo = variable.getJSDocInfo();
    Node iterName =
        withType(IR.name(ITER_BASE + compiler.getUniqueNameIdSupplier().get()), iteratorType);
    iterName.makeNonIndexable();
    Node getNext =
        withType(
            IR.call(
                withType(
                    IR.getprop(iterName.cloneTree(), withStringType(IR.string("next"))),
                    iteratorNextType)),
            iIterableResultType);
    String iteratorResultName = ITER_RESULT;
    if (NodeUtil.isNameDeclaration(variable)) {
      iteratorResultName += variable.getFirstChild().getString();
    } else if (variable.isName()) {
      iteratorResultName += variable.getString();
    } else {
      // give arbitrary lhs expressions an arbitrary name
      iteratorResultName += namer.generateNextName();
    }
    Node iterResult = withType(IR.name(iteratorResultName), iIterableResultType);
    iterResult.makeNonIndexable();

    Node call = Es6ToEs3Util.makeIterator(compiler, iterable);
    if (addTypes) {
      // Create the function type for $jscomp.makeIterator.
      // Build "@param {string|!Iterable<T>|!Iterator<T>|!Arguments<T>}"
      UnionTypeBuilder paramBuilder =
          UnionTypeBuilder.create(registry)
              .addAlternate(registry.getNativeType(JSTypeNative.STRING_TYPE))
              .addAlternate(registry.getNativeType(JSTypeNative.ITERATOR_TYPE))
              .addAlternate(registry.getNativeType(JSTypeNative.ITERABLE_TYPE));
      JSType argumentsType = registry.getGlobalType("Arguments");
      // If the user didn't provide externs for Arguments, let TypeCheck take care of issuing a
      // warning.
      if (argumentsType != null) {
        paramBuilder.addAlternate(argumentsType);
      }
      FunctionType makeIteratorType =
          registry.createFunctionType(iteratorType, paramBuilder.build());

      // Put types on the $jscomp.makeIterator getprop
      Node getProp = call.getFirstChild();
      getProp.setJSType(makeIteratorType);
      // typing $jscomp as unknown since the $jscomp polyfill may not be injected before
      // typechecking. (See https://github.com/google/closure-compiler/issues/2908)
      getProp.getFirstChild().setJSType(registry.getNativeType(JSTypeNative.UNKNOWN_TYPE));
      getProp.getSecondChild().setJSType(registry.getNativeType(JSTypeNative.STRING_TYPE));

      call.setJSType(iteratorType);
    }
    Node init = IR.var(withType(iterName.cloneTree(), iterName.getJSType()), call);
    Node initIterResult = iterResult.cloneTree();
    initIterResult.addChildToFront(getNext.cloneTree());
    init.addChildToBack(initIterResult);

    Node cond =
        withBooleanType(
            IR.not(
                withBooleanType(
                    IR.getprop(iterResult.cloneTree(), withStringType(IR.string("done"))))));
    Node incr =
        withType(IR.assign(iterResult.cloneTree(), getNext.cloneTree()), iIterableResultType);

    Node declarationOrAssign;
    if (!NodeUtil.isNameDeclaration(variable)) {
      declarationOrAssign =
          withType(
              IR.assign(
                  withType(variable.cloneTree().setJSDocInfo(null), typeParam),
                  withType(
                      IR.getprop(iterResult.cloneTree(), withStringType(IR.string("value"))),
                      typeParam)),
              typeParam);
      declarationOrAssign.setJSDocInfo(varJSDocInfo);
      declarationOrAssign = IR.exprResult(declarationOrAssign);
    } else {
      Token declarationType = variable.getToken(); // i.e. VAR, CONST, or LET.
      declarationOrAssign =
          new Node(
                  declarationType,
                  IR.name(variable.getFirstChild().getString())
                      .useSourceInfoFrom(variable.getFirstChild()))
              .setJSType(typeParam);
      declarationOrAssign.getFirstChild().addChildToBack(
              withType(
                  IR.getprop(iterResult.cloneTree(), withStringType(IR.string("value"))),
                  typeParam));
      declarationOrAssign.setJSDocInfo(varJSDocInfo);
    }
    Node newBody = IR.block(declarationOrAssign, body).useSourceInfoFrom(body);
    Node newFor = IR.forNode(init, cond, incr, newBody);
    newFor.useSourceInfoIfMissingFromForTree(node);
    parent.replaceChild(node, newFor);
    compiler.reportChangeToEnclosingScope(newFor);
  }
321663
public static final void serverShortName(String name)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "serverShortName", name);

        _serverShortName = name;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "serverShortName");
    }
1008794
private void handleDmrString(final ModelNode node, final String name, final String value) {
        final String realValue = value.substring(2);
        node.get(name).set(ModelNode.fromString(realValue));
    }
806614
public void inc(String name, int con) throws IOException
    {
        if (hasLocalVariable(name))
        {
            tinc(name, con);
        }
        else
        {
            VariableElement field = El.getField(subClass, name);
            if (field == null)
            {
                throw new IllegalArgumentException("field "+name+" not found");
            }
            aload(0);
            getField(field);
            TypeMirror type = field.asType();
            tconst(type, con);
            tadd(type);
            aload(0);
            swap();
            putField(field);
        }
    }
1017100
public static final void cellName(String name)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "cellName", name);

        _cellName = name;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "cellName");
    }
135871
def visit_Variable(self, node):
        """"""
        var_name = node.identifier.name
        var_symbol = self.table[var_name]

        if var_symbol is None:
            raise SementicError(f"Variable `{var_name}` is not declared.")