Void has no address.

This commit is contained in:
Axel Naumann
2014-05-26 17:30:45 +02:00
committed by sftnight
parent 6e9cd68cb2
commit 39ed28c03e
2 changed files with 4 additions and 5 deletions

View File

@ -216,9 +216,8 @@ static void StreamClingValue(llvm::raw_ostream& o, const Value* value) {
o << value->simplisticCastAs<unsigned long long>(); o << value->simplisticCastAs<unsigned long long>();
} else if (valType->isBooleanType()) } else if (valType->isBooleanType())
o << (value->simplisticCastAs<bool>() ? "true" : "false"); o << (value->simplisticCastAs<bool>() ? "true" : "false");
else { else if (!valType->isVoidType())
StreamValue(o, value->getPtr(), valType, value->getASTContext()); StreamValue(o, value->getPtr(), valType, value->getASTContext());
}
o << "]"; o << "]";
} }
} }

View File

@ -18,16 +18,16 @@ gCling->evaluate("return 1;", V);
V // CHECK: (cling::Value &) boxes [(int) 1] V // CHECK: (cling::Value &) boxes [(int) 1]
gCling->evaluate("(void)V", V); gCling->evaluate("(void)V", V);
V // CHECK-NEXT: (cling::Value &) boxes [(void) @0x{{.*}}] V // CHECK-NEXT: (cling::Value &) boxes [(void) ]
// Returns must put the result in the Value. // Returns must put the result in the Value.
bool cond = true; bool cond = true;
gCling->evaluate("if (cond) return \"true\"; else return 0;", V); gCling->evaluate("if (cond) return \"true\"; else return 0;", V);
V // CHECK-NEXT: (cling::Value &) boxes [(const char [5]) "true"] V // CHECK-NEXT: (cling::Value &) boxes [(const char [5]) "true"]
gCling->evaluate("if (cond) return; else return 12;", V); gCling->evaluate("if (cond) return; else return 12;", V);
V // CHECK-NEXT: (cling::Value &) boxes [(void) @0x{{.*}}] V // CHECK-NEXT: (cling::Value &) boxes [(void) ]
gCling->evaluate("if (cond) return; int aa = 12;", V); gCling->evaluate("if (cond) return; int aa = 12;", V);
V // CHECK-NEXT: (cling::Value &) boxes [(void) @0x{{.*}}] V // CHECK-NEXT: (cling::Value &) boxes [(void) ]
gCling->evaluate("cond = false; if (cond) return \"true\"; else return 0;", V); gCling->evaluate("cond = false; if (cond) return \"true\"; else return 0;", V);
V // CHECK-NEXT: (cling::Value &) boxes [(int) 0] V // CHECK-NEXT: (cling::Value &) boxes [(int) 0]