Fix the address of a label to be properly considered and emitted as a
constant.

llvm-svn: 62948
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 9d709d3..0e31cac 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -619,6 +619,12 @@
       
       return CGM.GetAddrOfConstantCString(Str, ".tmp");
     }
+    case Expr::AddrLabelExprClass: {
+      assert(CGF && "Invalid address of label expression outside function.");
+      unsigned id = CGF->GetIDForAddrOfLabel(cast<AddrLabelExpr>(E)->getLabel());
+      llvm::Constant *C = llvm::ConstantInt::get(llvm::Type::Int32Ty, id);
+      return llvm::ConstantExpr::getIntToPtr(C, ConvertType(E->getType()));
+    }
     }
     CGM.ErrorUnsupported(E, "constant l-value expression");
     llvm::Type *Ty = llvm::PointerType::getUnqual(ConvertType(E->getType()));