From 1de4d4e8cb2e9c88809fea8092bc6e835a5473d2 Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 7 Apr 2011 08:22:57 +0000 Subject: Basic, untested implementation for an "unknown any" type requested by LLDB. The idea is that you can create a VarDecl with an unknown type, or a FunctionDecl with an unknown return type, and it will still be valid to access that object as long as you explicitly cast it at every use. I'm still going back and forth about how I want to test this effectively, but I wanted to go ahead and provide a skeletal implementation for the LLDB folks' benefit and because it also improves some diagnostic goodness for placeholder expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129065 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 92e6a19c25..a35f81ca20 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1930,6 +1930,12 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { ConvertType(ToType)); return MakeAddrLValue(V, E->getType()); } + case CK_ResolveUnknownAnyType: { + const DeclRefExpr *declRef = cast(E->getSubExpr()); + llvm::Constant *addr = CGM.getAddrOfUnknownAnyDecl(declRef->getDecl(), + E->getType()); + return MakeAddrLValue(addr, E->getType()); + } } llvm_unreachable("Unhandled lvalue cast kind?"); -- cgit v1.2.3