diff options
author | John McCall <rjmccall@apple.com> | 2010-11-18 06:31:45 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-18 06:31:45 +0000 |
commit | 7decc9e4ea6c56ffce14d25f542f5eda3eeba97a (patch) | |
tree | 534c07409e36400c14c13c70f78f8aec207b99cc /clang/lib/Sema/SemaChecking.cpp | |
parent | e5a1e8ae12781d504c7541ed0aa97a29360dacd6 (diff) | |
download | bcm5719-llvm-7decc9e4ea6c56ffce14d25f542f5eda3eeba97a.tar.gz bcm5719-llvm-7decc9e4ea6c56ffce14d25f542f5eda3eeba97a.zip |
Calculate the value kind of an expression when it's created and
store it on the expression node. Also store an "object kind",
which distinguishes ordinary "addressed" l-values (like
variable references and pointer dereferences) and bitfield,
@property, and vector-component l-values.
Currently we're not using these for much, but I aim to switch
pretty much everything calculating l-valueness over to them.
For now they shouldn't necessarily be trusted.
llvm-svn: 119685
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index d04addd2103..ed45de53f26 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -487,8 +487,9 @@ Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) { // GCC does an implicit conversion to the pointer or integer ValType. This // can fail in some cases (1i -> int**), check for this error case now. CastKind Kind = CK_Invalid; + ExprValueKind VK = VK_RValue; CXXCastPath BasePath; - if (CheckCastTypes(Arg->getSourceRange(), ValType, Arg, Kind, BasePath)) + if (CheckCastTypes(Arg->getSourceRange(), ValType, Arg, Kind, VK, BasePath)) return ExprError(); // Okay, we have something that *can* be converted to the right type. Check @@ -497,7 +498,7 @@ Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) { // pass in 42. The 42 gets converted to char. This is even more strange // for things like 45.123 -> char, etc. // FIXME: Do this check. - ImpCastExprToType(Arg, ValType, Kind, VK_RValue, &BasePath); + ImpCastExprToType(Arg, ValType, Kind, VK, &BasePath); TheCall->setArg(i+1, Arg); } |