Make the Kaleidoscope Orc examples -Wdeprecated clean by avoiding copying some AST...
[oota-llvm.git] / examples / Kaleidoscope / Orc / initial / toy.cpp
index 8dab73bf73ae9a78527f56a4e8edbeeb155bade2..085d0da8f512cde6b5c70108d821a072002570be 100644 (file)
@@ -781,7 +781,7 @@ Value *BinaryExprAST::IRGen(IRGenContext &C) const {
   // Special case '=' because we don't want to emit the LHS as an expression.
   if (Op == '=') {
     // Assignment requires the LHS to be an identifier.
-    auto LHSVar = static_cast<VariableExprAST&>(*LHS);
+    auto &LHSVar = static_cast<VariableExprAST &>(*LHS);
     // Codegen the RHS.
     Value *Val = RHS->IRGen(C);
     if (!Val) return nullptr;