summaryrefslogtreecommitdiffstats
path: root/clang/Sema
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2007-10-12 23:56:29 +0000
committerAnders Carlsson <andersca@mac.com>2007-10-12 23:56:29 +0000
commit24ebce6fcaa2813b8fb70cccd8be29796192a7aa (patch)
tree6b16e2085e48a0a4ab01cdbf89fa5c6d8c2c32e7 /clang/Sema
parentfd0312ed792f0d7e6e890fe92865a7abad96617e (diff)
downloadbcm5719-llvm-24ebce6fcaa2813b8fb70cccd8be29796192a7aa.tar.gz
bcm5719-llvm-24ebce6fcaa2813b8fb70cccd8be29796192a7aa.zip
Generate code for va_start and va_end.
llvm-svn: 42939
Diffstat (limited to 'clang/Sema')
-rw-r--r--clang/Sema/SemaDecl.cpp4
-rw-r--r--clang/Sema/SemaExpr.cpp8
2 files changed, 7 insertions, 5 deletions
diff --git a/clang/Sema/SemaDecl.cpp b/clang/Sema/SemaDecl.cpp
index e7b717c59c0..472df150e8b 100644
--- a/clang/Sema/SemaDecl.cpp
+++ b/clang/Sema/SemaDecl.cpp
@@ -152,7 +152,9 @@ ScopedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned bid,
Scope *S) {
Builtin::ID BID = (Builtin::ID)bid;
- if (BID == Builtin::BI__builtin_va_start &&
+ if ((BID == Builtin::BI__builtin_va_start ||
+ BID == Builtin::BI__builtin_va_copy ||
+ BID == Builtin::BI__builtin_va_end) &&
Context.getBuiltinVaListType().isNull()) {
IdentifierInfo *VaIdent = &Context.Idents.get("__builtin_va_list");
ScopedDecl *VaDecl = LookupScopedDecl(VaIdent, Decl::IDNS_Ordinary,
diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp
index 44b3e73fbb4..54e67141f20 100644
--- a/clang/Sema/SemaExpr.cpp
+++ b/clang/Sema/SemaExpr.cpp
@@ -1014,7 +1014,10 @@ Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) {
if (lhsType == rhsType) // common case, fast path...
return Compatible;
- if (lhsType->isArithmeticType() && rhsType->isArithmeticType()) {
+ if (lhsType->isReferenceType() || rhsType->isReferenceType()) {
+ if (Type::referenceTypesAreCompatible(lhsType, rhsType))
+ return Compatible;
+ } else if (lhsType->isArithmeticType() && rhsType->isArithmeticType()) {
if (lhsType->isVectorType() || rhsType->isVectorType()) {
if (lhsType.getCanonicalType() != rhsType.getCanonicalType())
return Incompatible;
@@ -1036,9 +1039,6 @@ Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) {
} else if (isa<TagType>(lhsType) && isa<TagType>(rhsType)) {
if (Type::tagTypesAreCompatible(lhsType, rhsType))
return Compatible;
- } else if (lhsType->isReferenceType() || rhsType->isReferenceType()) {
- if (Type::referenceTypesAreCompatible(lhsType, rhsType))
- return Compatible;
}
return Incompatible;
}
OpenPOWER on IntegriCloud