llvm-project/clang/lib/AST
Richard Trieu be234c30ad Split interesting warnings off from -Wfloat-conversion
Restructure the implict floating point to integer conversions so that
interesting sub-groups are under different flags.  Breakdown of warnings:

No warning:
Exact conversions from floating point to integer:
int x = 10.0;
int x = 1e10;

-Wliteral-conversion - Floating point literal to integer with rounding:
int x = 5.5;
int x = -3.4;

-Wfloat-conversion - All conversions not covered by the above two:
int x = GetFloat();
int x = 5.5 + 3.5;

-Wfloat-zero-conversion - The expression converted has a non-zero floating
point value that gets converted to a zero integer value, excluded the cases
falling under -Wliteral-conversion.  Subset of -Wfloat-conversion.
int x = 1.0 / 2.0;

-Wfloat-overflow-conversion - The floating point value is outside the range
of the integer type, exluding cases from -Wliteral conversion.  Subset of
-Wfloat-conversion.
char x = 500;
char x = -1000;

-Wfloat-bool-conversion - Any conversion of a floating point type to bool.
Subset of -Wfloat-conversion.
if (GetFloat()) {}
bool x = 5.0;

-Wfloat-bool-constant-conversion - Conversion of a compile time evaluatable
floating point value to bool.  Subset of -Wfloat-bool-conversion.
bool x = 1.0;
bool x = 4.0 / 20.0;

Also add EvaluateAsFloat to Sema, which is similar to EvaluateAsInt, but for
floating point values.

llvm-svn: 267054
2016-04-21 21:04:55 +00:00
..
APValue.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
ASTConsumer.cpp Move LocInfoType from Sema to AST. 2016-02-01 17:42:01 +00:00
ASTContext.cpp Revert 266186 as it breaks anything that includes type_traits on some platforms 2016-04-15 18:04:13 +00:00
ASTDiagnostic.cpp Fix Clang crash with template type diffing. 2016-03-30 22:23:00 +00:00
ASTDumper.cpp [OPENMP] Support dumping OpenMP specific constructs. 2016-03-31 09:30:50 +00:00
ASTImporter.cpp [ASTImporter] Implement some expression-related AST node import. 2016-04-14 11:51:27 +00:00
ASTTypeTraits.cpp Reorder ASTNodeKind::AllKindInfo to match NodeKindId. 2016-04-14 00:47:40 +00:00
AttrImpl.cpp Devirtualize Attr and all subclasses. 2015-03-19 16:06:49 +00:00
CMakeLists.txt Move functions declared in Stmt{ObjC,CXX}.h and OpenMPClause.h into 2015-10-02 13:41:04 +00:00
CXXABI.h [MS ABI] Correctly mangle classes without names for linkage purposes 2015-08-31 18:48:39 +00:00
CXXInheritance.cpp [OPENMP 4.0] Initial support for 'omp declare reduction' construct. 2016-03-03 05:21:39 +00:00
Comment.cpp Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. 2014-08-30 16:55:39 +00:00
CommentBriefParser.cpp
CommentCommandTraits.cpp Fix for PR21254 - Assertion in comment parser 2014-10-15 16:18:20 +00:00
CommentLexer.cpp Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes. 2016-02-10 19:11:58 +00:00
CommentParser.cpp [C++11] Use 'nullptr'. AST edition. 2014-05-12 05:36:57 +00:00
CommentSema.cpp Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes. 2016-02-10 19:11:58 +00:00
Decl.cpp [GCC] Attribute ifunc support in clang 2016-04-11 07:48:59 +00:00
DeclBase.cpp Warn if function or variable cannot be implicitly instantiated 2016-04-19 06:19:52 +00:00
DeclCXX.cpp P0017R1: In C++1z, an aggregate class can have (public non-virtual) base classes; these are initialized as if they were data members. 2016-03-08 22:17:41 +00:00
DeclFriend.cpp [TrailingObjects] Convert Decl* classes. 2015-12-29 22:13:13 +00:00
DeclGroup.cpp [TrailingObjects] Convert Decl* classes. 2015-12-29 22:13:13 +00:00
DeclObjC.cpp Fix ObjCMethodDecl::findPropertyDecl for class properties. 2016-03-11 21:14:40 +00:00
DeclOpenMP.cpp [OPENMP 4.0] Initial support for 'omp declare reduction' construct. 2016-03-03 05:21:39 +00:00
DeclPrinter.cpp [OPENMP] Parsing and Sema support for 'omp declare target' directive 2016-04-06 11:38:59 +00:00
DeclTemplate.cpp ArrayRef-ize TemplateParameterList. NFC 2015-12-27 07:16:27 +00:00
DeclarationName.cpp [AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in printing policy. 2016-02-15 01:32:36 +00:00
Expr.cpp [OPENMP 4.0] Fixed support of array sections/array subscripts. 2016-02-04 11:27:03 +00:00
ExprCXX.cpp Fix serialization/deserialization for __uuidof 2016-03-28 03:19:50 +00:00
ExprClassification.cpp [MSVC] 'property' with an empty array in array subscript expression. 2015-11-25 12:01:00 +00:00
ExprConstant.cpp Split interesting warnings off from -Wfloat-conversion 2016-04-21 21:04:55 +00:00
ExprObjC.cpp [TrailingObjects] Fix bug in "Convert classes in ExprObjC.h" 2015-12-31 06:01:19 +00:00
ExternalASTSource.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
InheritViz.cpp InheritViz: Hide implementation details 2015-03-09 15:03:20 +00:00
ItaniumCXXABI.cpp [MS ABI] Correctly mangle classes without names for linkage purposes 2015-08-31 18:48:39 +00:00
ItaniumMangle.cpp Revert 266186 as it breaks anything that includes type_traits on some platforms 2016-04-15 18:04:13 +00:00
Mangle.cpp Make TargetInfo store an actual DataLayout instead of a string. 2016-03-04 19:00:41 +00:00
MicrosoftCXXABI.cpp Update for LLVM function name change. 2016-01-14 21:00:27 +00:00
MicrosoftMangle.cpp Revert 266186 as it breaks anything that includes type_traits on some platforms 2016-04-15 18:04:13 +00:00
NSAPI.cpp Revert 266186 as it breaks anything that includes type_traits on some platforms 2016-04-15 18:04:13 +00:00
NestedNameSpecifier.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
OpenMPClause.cpp [OPENMP 4.0] Support for 'uniform' clause in 'declare simd' directive. 2016-04-12 05:28:34 +00:00
ParentMap.cpp Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops. 2015-07-02 21:03:14 +00:00
RawCommentList.cpp Allow any comment to be a trailing comment when -fparse-all-comments is on. 2015-07-15 19:13:39 +00:00
RecordLayout.cpp CXXInfo memory should be released after calling the destructor 2014-05-24 07:19:25 +00:00
RecordLayoutBuilder.cpp pr26544: Bitfield layout with pragma pack and attributes "packed" and 2016-02-19 11:23:28 +00:00
SelectorLocationsKind.cpp
Stmt.cpp Update for LLVM function name change. 2016-01-14 21:00:27 +00:00
StmtCXX.cpp P0184R0: Allow types of 'begin' and 'end' expressions in range-based for loops to differ. 2016-03-20 10:33:40 +00:00
StmtIterator.cpp [ptr-traits] Stop using two bogus types as stand-ins for flags 2015-12-30 02:51:00 +00:00
StmtObjC.cpp Move functions declared in Stmt{ObjC,CXX}.h and OpenMPClause.h into 2015-10-02 13:41:04 +00:00
StmtOpenMP.cpp [OPENMP] Remove extra code transformation. 2016-03-29 08:58:54 +00:00
StmtPrinter.cpp Revert 266186 as it breaks anything that includes type_traits on some platforms 2016-04-15 18:04:13 +00:00
StmtProfile.cpp [Cxx1z] Implement Lambda Capture of *this by Value as [=,*this] (P0018R3) 2016-03-21 09:25:37 +00:00
StmtViz.cpp
TemplateBase.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
TemplateName.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
Type.cpp Revert 266186 as it breaks anything that includes type_traits on some platforms 2016-04-15 18:04:13 +00:00
TypeLoc.cpp Revert 266186 as it breaks anything that includes type_traits on some platforms 2016-04-15 18:04:13 +00:00
TypePrinter.cpp Revert r266415, it broke parsing SDK headers (PR27367). 2016-04-15 14:35:06 +00:00
VTTBuilder.cpp Update for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool> as per the C++ standard's associative container concept. 2014-11-19 07:49:47 +00:00
VTableBuilder.cpp Revert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables"" 2016-02-11 17:49:28 +00:00