[PATCH] D51329: [Attribute/Diagnostics] Print macro instead of whole attribute for address_space

2018-08-27 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. Actually, after posting this I realize I didn't handle the macro expansion very well. I'll fix this first. Repository: rC Clang https://reviews.llvm.org/D51329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D51329: [Attribute/Diagnostics] Print macro instead of whole attribute for address_space

2018-08-28 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 162966. leonardchan marked 3 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D51329 Files: include/clang/AST/ASTContext.h include/clang/AST/Type.h include/clang/Lex/Preprocessor.h lib/AST/ASTContext.cpp lib/AST/TypePrin

[PATCH] D51329: [Attribute/Diagnostics] Print macro instead of whole attribute for address_space

2018-08-28 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/AST/TypePrinter.cpp:1370 + +// Remove the underlying address space so it won't be printed. +SplitQualType SplitTy = T->getModifiedType().split(); rsmith wrote: > This is unnecessary; just print the modifi

[PATCH] D51329: [Attribute/Diagnostics] Print macro instead of whole attribute for address_space

2018-08-29 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 163155. Repository: rC Clang https://reviews.llvm.org/D51329 Files: include/clang/AST/ASTContext.h include/clang/AST/Type.h include/clang/Lex/Preprocessor.h include/clang/Sema/ParsedAttr.h lib/AST/ASTContext.cpp lib/AST/TypePrinter.cpp li

[PATCH] D51329: [Attribute/Diagnostics] Print macro instead of whole attribute for address_space

2018-08-29 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/AST/TypePrinter.cpp:1370 + +// Remove the underlying address space so it won't be printed. +SplitQualType SplitTy = T->getModifiedType().split(); rsmith wrote: > leonardchan wrote: > > rsmith wrote: > > >

[PATCH] D51329: [Attribute/Diagnostics] Print macro instead of whole attribute for address_space

2018-08-30 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked 5 inline comments as done. leonardchan added a comment. @rsmith When you clarify what you mean by `outermost macro expansion`? Say I have the following: #define ATTR __attribute__ #define AS(i) address_space(i) #define AS1 ATTR((address_space(1))) #define AS2 ATTR((AS(

[PATCH] D51329: [Attribute/Diagnostics] Print macro instead of whole attribute for address_space

2018-08-30 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/Parse/ParseDecl.cpp:244-252 +// If this was declared in a macro, attatch the macro IdentifierInfo to the +// parsed attribute. +for (const auto &MacroPair : PP.getAttributeMacros()) { + if (SourceLocInSourceRange

[PATCH] D51329: [Attribute/Diagnostics] Print macro instead of whole attribute for address_space

2018-08-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 163604. leonardchan marked 8 inline comments as done. leonardchan added a comment. - Removed default value for `getAttributedType` and added any macro identifier necessary as a fourth argument to `getAttributedType` - Added tracking for `LateAttr`s to kee

[PATCH] D51329: [Attribute/Diagnostics] Print macro instead of whole attribute for address_space

2018-08-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/AST/TypePrinter.cpp:1370 + +// Remove the underlying address space so it won't be printed. +SplitQualType SplitTy = T->getModifiedType().split(); rsmith wrote: > leonardchan wrote: > > rsmith wrote: > > >

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-09-05 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 164136. leonardchan added a comment. - Push and pop a new ExpressionEvaluationContext when we enter and exit a compound statement. - Remove Start/StopCheckingNoderef functions since we can now warn whenever we pop Repository: rC Clang https://review

[PATCH] D51329: [Attribute/Diagnostics] Print macro instead of whole attribute for address_space

2018-09-10 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked 7 inline comments as done. leonardchan added a comment. @rsmith So I chose to go with the type sugar route since we would prefer to have multiple attributes in one attribute list. This type just contains the underlying type and the macro identifier originally held by the `Att

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-09-10 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 164706. leonardchan added a comment. - Push and pop contexts for every parsed statement inside `ParseStatementOrDeclaration` instead of at the start and end of compound statements Repository: rC Clang https://reviews.llvm.org/D49511 Files: includ

[PATCH] D48661: [Fixed Point Arithmetic] Fixed Point Constant

2018-07-19 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 156280. leonardchan marked an inline comment as done. Repository: rC Clang https://reviews.llvm.org/D48661 Files: include/clang/AST/ASTContext.h include/clang/Basic/FixedPoint.h include/clang/Basic/TargetInfo.h lib/AST/ASTContext.cpp lib/Basi

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-07-20 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 156634. leonardchan marked 2 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D49511 Files: include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/DiagnosticGroups.td inc

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-07-20 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. In https://reviews.llvm.org/D49511#1168692, @rsmith wrote: > The way in which you're checking for the problematic cases is unnecessarily > expensive. Instead of performing a separate AST traversal, please detect > whether you should be producing the warning directly

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-07-23 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 156826. leonardchan marked 21 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D49511 Files: include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrDocs.td include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-07-23 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/AttrDocs.td:3426 + let Content = [{ +The ``noderef`` attribute causes clang to throw a warning whenever a pointer marked with +this attribute is dereferenced. This is ideally used with pointers that point to sp

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-07-25 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. @aaron.ballman @rsmith Any more feedback on this patch? Repository: rC Clang https://reviews.llvm.org/D49511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[PATCH] D49876: [Fixed Point Arithmetic] Addition of intrinsic/builtin functions

2018-07-26 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added a project: clang. Herald added a subscriber: cfe-commits. This patch is not actually up for review and meant to hold the remaining work done after https://reviews.llvm.org/D47017 but haven't submitted for review yet. This patch contains: - `m

[PATCH] D49945: [Fixed Point Arithmetic] Fix for FixedPointValueToString

2018-07-27 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich, ebevhan, rjmccall. leonardchan added a project: clang. Herald added a subscriber: mgorny. - Print negative numbers correctly - Handle APInts of different sizes - Add formal unit tests for FixedPointValu

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-07-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 158407. leonardchan marked 6 inline comments as done. leonardchan added a comment. - Added tests for checking that `noderef` can only be used for C style pointers and arrays (not usable for references or ObjC pointers) - Added warnings for dereferencing a

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-07-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. > You shouldn't be adding your own `ExpressionEvaluationContextRecord`s. What I > was suggesting is that you store a list of pending `noderef` expressions on > the record, and diagnose them when the record is popped (if they've not been > removed since). This is

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-07-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. > Your current counter-based approach doesn't work very well in the case where > we switch to another context while processing an expression (for example, > during template instantiation): you'll defer all the diagnostics for the > inner construct until the outer co

[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

2018-07-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 158423. leonardchan added a comment. - Moved the counter and set into `ExpressionEvaluationContextRecord` Repository: rC Clang https://reviews.llvm.org/D49511 Files: include/clang/AST/Type.h include/clang/Basic/Attr.td include/clang/Basic/AttrD

[PATCH] D50278: [Sema] Fix for crash on conditional operation with address_space pointer

2018-08-03 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, rsmith. leonardchan added a project: clang. Compiling the following causes clang to crash void cmp(char *x, __attribute__((address_space(2))) char *y) { 0 ? x : y; } with the message: "wrong cast for poin

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-30 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 149162. Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/LangOptions.def i

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-30 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/TokenKinds.def:393 +// ISO/IEC JTC1 SC22 WG14 N1169 Extension +KEYWORD(_Accum , KEYALL) + jfb wrote: > ebevhan wrote: > > I believe that having KEYALL will enable the keyword

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-05-30 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 149169. leonardchan added a comment. Forgot to include tests for the `_Fract` and `_Sat` keywords in c++ usage Repository: rC Clang https://reviews.llvm.org/D46911 Files: include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 149305. leonardchan marked 6 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticCommonKind

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/TokenKinds.def:393 +// ISO/IEC JTC1 SC22 WG14 N1169 Extension +KEYWORD(_Accum , KEYALL) + rsmith wrote: > leonardchan wrote: > > jfb wrote: > > > ebevhan wrote: > > > > I beli

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/Basic/TargetInfo.cpp:45 + AccumWidth = AccumAlign = 32; + LongAccumWidth = LongAccumAlign = 64; SuitableAlign = 64; leonardchan wrote: > ebevhan wrote: > > leonardchan wrote: > > > rsmith wrote: > > > > jfb

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-05-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 149360. leonardchan marked 7 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D46911 Files: include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/AST/Type.h include/clang/Basic/DiagnosticSemaKinds

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-05-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/Sema/DeclSpec.cpp:1123 +if (!(TypeSpecType == TST_accum || TypeSpecType == TST_fract)) { + S.Diag(TSSatLoc, diag::err_invalid_saturation_spec) + << getSpecifierName((TST)TypeSpecType, Policy); e

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-06-01 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. Hi all, I'll be attempting to commit this patch around 6pm PT today unless anyone has any more comments on this specific patch. Any other suggestions regarding potential design changes can be discussed in future patches since this is only the first of many. Reposi

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-06-01 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 149533. leonardchan marked an inline comment as done. Repository: rC Clang https://reviews.llvm.org/D46911 Files: include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/AST/Type.h include/clang/Basic/DiagnosticSemaKinds

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-06-01 Thread Leonard Chan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL333814: This diff includes changes for supporting the following types. (authored by leonardchan, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.or

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-06-05 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. @ebevhan Does everything look good in this patch? I'm almost done with the next one. Writing tests for it still. Repository: rC Clang https://reviews.llvm.org/D46911 ___ cfe-commits mailing list cfe-commits@lists.llv

[PATCH] D46915: [Fixed Point Arithmetic] Set Fixed Point Precision Bits and Create Fixed Point Literals

2018-06-06 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 150248. leonardchan marked 20 inline comments as done. leonardchan added a comment. - Moved definition of the fractional/integral bits to TargetInfo. Checks are also performed to make sure any target specific definitions of the F/IBits follow the restric

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-06 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/AST/ExprConstant.cpp:9323 + if (Value.isSigned() && Value.isMinSignedValue() && E->canOverflow() && + !HandleOverflow(Info, E, -Value.extend(Value.getBitWidth() + 1), + E->getType())) --

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-06-07 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Sema/DeclSpec.h:670 const PrintingPolicy &Policy); + bool SetTypeSpecSat(SourceLocation Loc, const char *&PrevSpec, + unsigned &DiagID); ebevhan wrote: > Th

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-08 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 150602. leonardchan marked 14 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D46915 Files: include/clang/AST/ASTContext.h include/clang/AST/Expr.h include/clang/AST/OperationKinds.def include/clang/AST/RecursiveASTVisito

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-08 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/AST/Type.h:6552 +// as a scaled integer. +std::string FixedPointValueToString(unsigned Radix, unsigned Scale, +uint64_t Val); ebevhan wrote: > This should probably ta

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-12 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 151016. leonardchan marked 9 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D46915 Files: include/clang/AST/ASTContext.h include/clang/AST/Expr.h include/clang/AST/OperationKinds.def include/clang/AST/RecursiveASTVisitor

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-12 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/TargetInfo.h:89 + // corresponding unsaturated types. + unsigned char ShortAccumFBits, ShortAccumIBits; + unsigned char AccumFBits, AccumIBits; ebevhan wrote: > leonardchan wrote: > > ebevhan w

[PATCH] D47030: [Fixed Point Arithmetic] Checks for Precision Macros

2018-06-12 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan abandoned this revision. leonardchan added a comment. No longer setting fractional and integral bits at configure time. These values are set and checked in TargetInfo. Repository: rC Clang https://reviews.llvm.org/D47030 ___ cfe-comm

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-06-13 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 151184. leonardchan marked an inline comment as done. Repository: rC Clang https://reviews.llvm.org/D46911 Files: include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/AST/Type.h include/clang/Basic/DiagnosticSemaKinds

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-06-13 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: test/Frontend/fixed_point_bit_widths.c:44 + +// CHECK-NEXT: @size_SsF = dso_local global i{{[0-9]+}} 2 +// CHECK-NEXT: @size_SF = dso_local global i{{[0-9]+}} 4 ebevhan wrote: > Wait; should these dso_local be `{{

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-13 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/TargetInfo.h:89 + // corresponding unsaturated types. + unsigned char ShortAccumFBits, ShortAccumIBits; + unsigned char AccumFBits, AccumIBits; ebevhan wrote: > leonardchan wrote: > > ebevhan w

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-06-14 Thread Leonard Chan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC334718: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their… (authored by leonardchan, committed by ). Repository: rL LLVM https://reviews.llvm.org/D46911 Files: include/c

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-06-14 Thread Leonard Chan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL334718: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their… (authored by leonardchan, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https:

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-14 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/TargetInfo.h:89 + // corresponding unsaturated types. + unsigned char ShortAccumFBits, ShortAccumIBits; + unsigned char AccumFBits, AccumIBits; ebevhan wrote: > leonardchan wrote: > > ebevhan w

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-14 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 151431. leonardchan added a comment. Removed FractFBits property. Fractional bits for _Fract types are now one less the _Fract width unless `SameFBits` is specified. In that case, the number of FBits in unsigned _Fract is the same as that of signed _Frac

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-14 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 151433. leonardchan added a comment. - Removed the functions for performing casting between fixed point types to a common type when performing a binary operation since operations should be performed on the types as is. Also this patch is meant more for d

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-18 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 151744. leonardchan added a comment. - Removed CK_IntegralToFixedPoint to be added to later patch addressing conversion - Create CXString for FixedPointLiteral Repository: rC Clang https://reviews.llvm.org/D46915 Files: include/clang-c/Index.h i

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-18 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/Sema/SemaExpr.cpp:1248 + bool RHSFixed = RHSType->isFixedPointType(); + + if (LHSFixed && RHSFixed) { ebevhan wrote: > ebevhan wrote: > > leonardchan wrote: > > > leonardchan wrote: > > > > ebevhan wrote: > > >

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-19 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked an inline comment as done. leonardchan added inline comments. Comment at: lib/Sema/SemaExpr.cpp:1248 + bool RHSFixed = RHSType->isFixedPointType(); + + if (LHSFixed && RHSFixed) { ebevhan wrote: > leonardchan wrote: > > leonardchan wrote: > >

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-19 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 151919. leonardchan marked 2 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D46915 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/Expr.h include/clang/AST/RecursiveASTVisitor.h include/

[PATCH] D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals

2018-06-20 Thread Leonard Chan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. leonardchan marked an inline comment as done. Closed by commit rC335148: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals (authored by leonardchan, committed by ). Repository: rC Clang https:/

[PATCH] D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types

2018-06-21 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich, rsmith, ebevhan. leonardchan added a project: clang. leonardchan added a dependency: D46917: [Fixed Point Arithmetic] Comparison and Unary Operations for Fixed Point Types. Add support for casting betw

[PATCH] D46926: [Fixed Point Arithmetic] Conversion between Fixed Point and Floating Point Numbers

2018-06-21 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan abandoned this revision. leonardchan added a comment. The logic in this patch is moved to https://reviews.llvm.org/D48456 Repository: rC Clang https://reviews.llvm.org/D46926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[PATCH] D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types

2018-06-21 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 152385. Repository: rC Clang https://reviews.llvm.org/D48456 Files: include/clang/AST/ASTContext.h include/clang/AST/OperationKinds.def include/clang/AST/Type.h include/clang/Basic/DiagnosticSemaKinds.td include/clang/Basic/TargetInfo.h inc

[PATCH] D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types

2018-06-22 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 152525. leonardchan added a comment. - Add test case for fix where 0.0r would resolve as -1 when creating a fixed point literal. Repository: rC Clang https://reviews.llvm.org/D48456 Files: include/clang/AST/ASTContext.h include/clang/AST/Operati

[PATCH] D50616: [Fixed Point Arithmetic] FixedPointCast

2018-10-09 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. @ebevhan @rjmccall Seeing that the saturation intrinsic in https://reviews.llvm.org/D52286 should be put on hold for now, would it be fine to submit this patch as is? Then if the intrinsic is finished, come back to this and update this patch to use the intrinsic?

[PATCH] D53170: [clang-doc] Switch to default to all-TUs executor

2018-10-11 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: clang-tools-extra/clang-doc/tool/ClangDocMain.cpp:90-92 +static llvm::cl::opt +ClangDocExecutorName("doc-executor", llvm::cl::desc("The name of the executor to use in clang-doc."), + llvm::cl::init("all-TUs")); -

[PATCH] D50616: [Fixed Point Arithmetic] FixedPointCast

2018-10-12 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 169495. Repository: rC Clang https://reviews.llvm.org/D50616 Files: include/clang/AST/OperationKinds.def include/clang/AST/Type.h include/clang/Basic/DiagnosticCommonKinds.td lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/AST/Type.cpp lib/

[PATCH] D50616: [Fixed Point Arithmetic] FixedPointCast

2018-10-12 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 169500. leonardchan added a comment. - Removed target hook Repository: rC Clang https://reviews.llvm.org/D50616 Files: include/clang/AST/OperationKinds.def include/clang/AST/Type.h include/clang/Basic/DiagnosticCommonKinds.td lib/AST/Expr.cpp

[PATCH] D52814: [PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address

2018-10-12 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. In https://reviews.llvm.org/D52814#1262550, @philip.pfaffe wrote: > You're right, my bad; I missed the fact that it's EP_OptimizerLast, which has > no equivalent in the new PM. Your implementation is actually correct here. > > Did you run your test in a debug build?

[PATCH] D52814: [PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address

2018-10-12 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 169516. Repository: rC Clang https://reviews.llvm.org/D52814 Files: lib/CodeGen/BackendUtil.cpp test/CodeGen/asan-new-pm.ll Index: test/CodeGen/asan-new-pm.ll === --- /dev/null +++ t

[PATCH] D50616: [Fixed Point Arithmetic] FixedPointCast

2018-10-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 169714. leonardchan marked an inline comment as done. Repository: rC Clang https://reviews.llvm.org/D50616 Files: include/clang/AST/OperationKinds.def include/clang/AST/Type.h include/clang/Basic/DiagnosticCommonKinds.td lib/AST/Expr.cpp lib/

[PATCH] D50616: [Fixed Point Arithmetic] FixedPointCast

2018-10-15 Thread Leonard Chan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344530: [Fixed Point Arithmetic] FixedPointCast (authored by leonardchan, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D50616?vs=169714&id=1

[PATCH] D53299: [Fixed Point Arithmetic]

2018-10-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added a reviewer: bjope. leonardchan added a project: clang-tools-extra. Fix for warnings generated on unhandled enum value `STK_FixedPoint`. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53299 Files: clang-tools-extra/clang-tid

[PATCH] D53299: [Fixed Point Arithmetic] Fix for clang-tools-extra warning

2018-10-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 169741. leonardchan marked 2 inline comments as done. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53299 Files: clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp Index: clang-tools-extra/clang-tidy/modernize/UseDe

[PATCH] D53299: [Fixed Point Arithmetic] Fix for clang-tools-extra warning

2018-10-15 Thread Leonard Chan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE344549: [Fixed Point Arithmetic] Fix for clang-tools-extra warning (authored by leonardchan, committed by ). Changed prior to commit: https://reviews.llvm.org/D53299?vs=169741&id=169745#toc Repositor

[PATCH] D53308: [Fixed Point Arithmetic] Fixed Point to Boolean Cast

2018-10-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: ebevhan, rjmccall, bjope. leonardchan added a project: clang. This patch is a part of https://reviews.llvm.org/D48456 in an attempt to split the casting logic up into smaller patches. This contains the code for casting from fixed po

[PATCH] D52814: [PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address

2018-10-16 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. @philip.pfaffe @fedor.sergeev Do you have any more comments on this patch? Repository: rC Clang https://reviews.llvm.org/D52814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mai

[PATCH] D53308: [Fixed Point Arithmetic] Fixed Point to Boolean Cast

2018-10-16 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 169863. leonardchan marked 3 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D53308 Files: clang/include/clang/AST/OperationKinds.def clang/lib/AST/Expr.cpp clang/lib/AST/ExprConstant.cpp clang/lib/CodeGen/CGExpr.cpp cl

[PATCH] D53308: [Fixed Point Arithmetic] Fixed Point to Boolean Cast

2018-10-16 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1032 + // them. + return Builder.CreateIsNotNull(Src); +} ebevhan wrote: > Is this comment true? I don't think EmitFixedPointConversion does this. > > Maybe I'm misin

[PATCH] D52814: [PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address

2018-10-17 Thread Leonard Chan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344699: [PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with… (authored by leonardchan, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://r

[PATCH] D53381: [clang-doc] Bringing bitcode tests in line

2018-10-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan accepted this revision. leonardchan added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/unittests/clang-doc/BitcodeTest.cpp:39-40 +return writeInfo(*static_cast(I)); + default: +return ""; + } ---

[PATCH] D53308: [Fixed Point Arithmetic] Fixed Point to Boolean Cast

2018-10-22 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:2026 +return EmitScalarConversion(Visit(E), E->getType(), DestTy, +CE->getExprLoc()); ebevhan wrote: > rjmccall wrote: > > Why are you pushing

[PATCH] D53308: [Fixed Point Arithmetic] Fixed Point to Boolean Cast

2018-10-23 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:9599 + return false; +return Success(Val.getInt().getBoolValue(), E); + } rjmccall wrote: > I know you haven't really done constant-evaluation yet, but I think you > should a

[PATCH] D53308: [Fixed Point Arithmetic] Fixed Point to Boolean Cast

2018-10-23 Thread Leonard Chan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC345063: [Fixed Point Arithmetic] Fixed Point to Boolean Cast (authored by leonardchan, committed by ). Changed prior to commit: https://reviews.llvm.org/D53308?vs=169863&id=170699#toc Repository: rC

[PATCH] D53738: [Fixed Point Arithmetic] Fixed Point Addition

2018-10-25 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: ebevhan, bjope, rjmccall. leonardchan added a project: clang. This patch covers addition between fixed point types and other fixed point types or integers, using the conversion rules described in 4.1.4 of N1169. Usual arithmetic ru

[PATCH] D53738: [Fixed Point Arithmetic] Fixed Point Addition

2018-10-25 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3223-3247 +if (ResultWidth < CommonWidth) { + // In the event we extended the sign of both operands, the intrinsic will + // not saturate to the initial bit width of the result type. I

[PATCH] D55868: [Fixed Point Arithmetic] Fixed Point Addition Constant Expression Evaluation

2019-01-11 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 181421. leonardchan marked 13 inline comments as done. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55868/new/ https://reviews.llvm.org/D55868 Files: clang/include/clang/AST/APValue.h clang/include/clang/AST/Expr.h

[PATCH] D55868: [Fixed Point Arithmetic] Fixed Point Addition Constant Expression Evaluation

2019-01-11 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. I ended up adding a lot to this patch, so feel free to let me know if I should split this up if it's more difficult to review. Changes: - Remove default ctors for `APFixedPoint` and `FixedPointSemantics`. The main reason I had these was so in the `EvaluateAsFixedPo

[PATCH] D55447: [Sema] Fix Modified Type in address_space AttributedType

2019-01-14 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 181719. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55447/new/ https://reviews.llvm.org/D55447 Files: clang/include/clang/Sema/Sema.h clang/lib/AST/Type.cpp clang/lib/AST/TypePrinter.cpp clang/lib/Sema/SemaType.c

[PATCH] D55447: [Sema] Fix Modified Type in address_space AttributedType

2019-01-14 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked an inline comment as done. leonardchan added inline comments. Comment at: clang/tools/libclang/CXType.cpp:132 + if (!(TU->ParsingOptions & CXTranslationUnit_IncludeAttributedTypes) && + ATT->getAttrKind() != attr::AddressSpace) { return M

[PATCH] D55447: [Sema] Fix Modified Type in address_space AttributedType

2019-01-14 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 181720. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55447/new/ https://reviews.llvm.org/D55447 Files: clang/include/clang/Sema/Sema.h clang/lib/AST/Type.cpp clang/lib/AST/TypePrinter.cpp clang/lib/Sema/SemaType.c

[PATCH] D55447: [Sema] Fix Modified Type in address_space AttributedType

2019-01-14 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 181721. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55447/new/ https://reviews.llvm.org/D55447 Files: clang/include/clang/Sema/Sema.h clang/lib/AST/Type.cpp clang/lib/AST/TypePrinter.cpp clang/lib/Sema/SemaType.c

[PATCH] D55447: [Sema] Fix Modified Type in address_space AttributedType

2019-01-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked an inline comment as done. leonardchan added inline comments. Comment at: clang/tools/libclang/CXType.cpp:132 + if (!(TU->ParsingOptions & CXTranslationUnit_IncludeAttributedTypes) && + ATT->getAttrKind() != attr::AddressSpace) { return M

[PATCH] D55447: [Sema] Fix Modified Type in address_space AttributedType

2019-01-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked an inline comment as done. leonardchan added inline comments. Comment at: clang/tools/libclang/CXType.cpp:132 + if (!(TU->ParsingOptions & CXTranslationUnit_IncludeAttributedTypes) && + ATT->getAttrKind() != attr::AddressSpace) { return M

[PATCH] D56746: [Fixed Point Arithmetic] Add APFixedPoint to APValue

2019-01-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: rjmccall, ebevhan, bjope. leonardchan added a project: clang. This adds APFixedPoint to the union of values that can be represented with an APValue. Repository: rC Clang https://reviews.llvm.org/D56746 Files: clang/include/cl

[PATCH] D56746: [Fixed Point Arithmetic] Add APFixedPoint to APValue

2019-01-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. Regarding tests, I couldn't actually find any under clang/unittests that test APValue specifically. Is it worth it to add some still? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56746/new/ https://reviews.llvm.org/D56746 ___

[PATCH] D55868: [Fixed Point Arithmetic] Fixed Point Addition Constant Expression Evaluation

2019-01-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 181897. leonardchan marked 10 inline comments as done. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55868/new/ https://reviews.llvm.org/D55868 Files: clang/include/clang/AST/Expr.h clang/include/clang/Basic/Diagnostic

[PATCH] D55868: [Fixed Point Arithmetic] Fixed Point Addition Constant Expression Evaluation

2019-01-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. In D55868#1358208 , @rjmccall wrote: > Yeah, I would recommend splitting the `APFixedPoint` in `APValue` changes > into a separate patch. Added D56746 as a child revision of this that has t

[PATCH] D53738: [Fixed Point Arithmetic] Fixed Point Addition

2019-01-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. In D53738#1358249 , @rjmccall wrote: > In D53738#172 , @rjmccall wrote: > > > In D53738#1333276 , @leonardchan > > wrote: > > > > > In D5373

[PATCH] D55447: [Sema] Fix Modified Type in address_space AttributedType

2019-01-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 181902. leonardchan marked an inline comment as done. Herald added a subscriber: arphaman. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55447/new/ https://reviews.llvm.org/D55447 Files: clang/include/clang/Sema/Sema.h

[PATCH] D55447: [Sema] Fix Modified Type in address_space AttributedType

2019-01-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked an inline comment as done. leonardchan added inline comments. Comment at: clang/tools/libclang/CXType.cpp:132 + if (!(TU->ParsingOptions & CXTranslationUnit_IncludeAttributedTypes) && + ATT->getAttrKind() != attr::AddressSpace) { return M

[PATCH] D56746: [Fixed Point Arithmetic] Add APFixedPoint to APValue

2019-01-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 181918. leonardchan marked an inline comment as done. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56746/new/ https://reviews.llvm.org/D56746 Files: clang/include/clang/AST/APValue.h clang/include/clang/AST/Type.h c

<    1   2   3   4   5   6   7   8   9   >