Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(919)

Side by Side Diff: lib/Sema/SemaChecking.cpp

Issue 1238843002: Cherry-pick upstream r238083 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-clang.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/Sema/atomic-compare.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===--- SemaChecking.cpp - Extra Semantic Checking -----------------------===// 1 //===--- SemaChecking.cpp - Extra Semantic Checking -----------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file implements extra semantic analysis beyond what is enforced 10 // This file implements extra semantic analysis beyond what is enforced
(...skipping 6034 matching lines...) Expand 10 before | Expand all | Expand 10 after
6045 Expr *Constant, Expr *Other, 6045 Expr *Constant, Expr *Other,
6046 llvm::APSInt Value, 6046 llvm::APSInt Value,
6047 bool RhsConstant) { 6047 bool RhsConstant) {
6048 // Disable warning in template instantiations. 6048 // Disable warning in template instantiations.
6049 if (!S.ActiveTemplateInstantiations.empty()) 6049 if (!S.ActiveTemplateInstantiations.empty())
6050 return; 6050 return;
6051 6051
6052 // TODO: Investigate using GetExprRange() to get tighter bounds 6052 // TODO: Investigate using GetExprRange() to get tighter bounds
6053 // on the bit ranges. 6053 // on the bit ranges.
6054 QualType OtherT = Other->getType(); 6054 QualType OtherT = Other->getType();
6055 if (const AtomicType *AT = dyn_cast<AtomicType>(OtherT)) 6055 if (const auto *AT = OtherT->getAs<AtomicType>())
6056 OtherT = AT->getValueType(); 6056 OtherT = AT->getValueType();
6057 IntRange OtherRange = IntRange::forValueOfType(S.Context, OtherT); 6057 IntRange OtherRange = IntRange::forValueOfType(S.Context, OtherT);
6058 unsigned OtherWidth = OtherRange.Width; 6058 unsigned OtherWidth = OtherRange.Width;
6059 6059
6060 bool OtherIsBooleanType = Other->isKnownToHaveBooleanValue(); 6060 bool OtherIsBooleanType = Other->isKnownToHaveBooleanValue();
6061 6061
6062 // 0 values are handled later by CheckTrivialUnsignedComparison(). 6062 // 0 values are handled later by CheckTrivialUnsignedComparison().
6063 if ((Value == 0) && (!OtherIsBooleanType)) 6063 if ((Value == 0) && (!OtherIsBooleanType))
6064 return; 6064 return;
6065 6065
(...skipping 3252 matching lines...) Expand 10 before | Expand all | Expand 10 after
9318 mismatch = !isLayoutCompatible(Context, ArgumentType, RequiredType); 9318 mismatch = !isLayoutCompatible(Context, ArgumentType, RequiredType);
9319 9319
9320 if (mismatch) 9320 if (mismatch)
9321 Diag(ArgumentExpr->getExprLoc(), diag::warn_type_safety_type_mismatch) 9321 Diag(ArgumentExpr->getExprLoc(), diag::warn_type_safety_type_mismatch)
9322 << ArgumentType << ArgumentKind 9322 << ArgumentType << ArgumentKind
9323 << TypeInfo.LayoutCompatible << RequiredType 9323 << TypeInfo.LayoutCompatible << RequiredType
9324 << ArgumentExpr->getSourceRange() 9324 << ArgumentExpr->getSourceRange()
9325 << TypeTagExpr->getSourceRange(); 9325 << TypeTagExpr->getSourceRange();
9326 } 9326 }
9327 9327
OLDNEW
« no previous file with comments | « no previous file | test/Sema/atomic-compare.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698