[PATCH] D50877: [MS] Mangle a hash of the main file path into anonymous namespaces

2018-08-16 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. How does MSVC handle this case? What mangled name does it generate? https://reviews.llvm.org/D50877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D44931: [WebAssembly] Use Windows EH instructions for Wasm EH

2018-05-16 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CGException.cpp:1164 + CurrentFuncletPad); + llvm::BasicBlock *CatchStartBlock = nullptr; + if (EHPersonality::get(*this).isWasmPersonality()) { Maybe this should be called WasmCatchStartBlock?

[PATCH] D44931: [WebAssembly] Use Windows EH instructions for Wasm EH

2018-05-20 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CGException.cpp:1173 +cast(CatchStartBlock->getFirstNonPHI()); +CurrentFuncletPad = CPI; + } aheejin wrote: > majnemer wrote: > > Hmm, why is this done? Won't RestoreCurrentFuncletPad undo this?

[PATCH] D37624: add support for -fno-instrument-functions and -finstrument-functions-exclude-{file, function}-list= to match gcc options.

2017-09-30 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CodeGenFunction.cpp:463 + + // Skip demangling if decl is extern "C" + if (ActualFuncDecl && !ActualFuncDecl->isExternC()) { Is this comment still correct? Comment at: lib/CodeGen/CodeGe

[PATCH] D37624: add support for -fno-instrument-functions and -finstrument-functions-exclude-{file, function}-list= to match gcc options.

2017-09-30 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CodeGenFunction.cpp:455 +for (const auto &FileMatch : PathSearch) { + if(FunctionDeclPath.find(FileMatch) != std::string::npos) { +return false; Space after if. Comment at

[PATCH] D38656: [CGExprScalar] In EmitCompare trunc the result if it has different type as E->getType()

2017-10-09 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CGExprScalar.cpp:3223-3224 + // crash later. + llvm::IntegerType *ResultTy = + dyn_cast(Result->getType()); + if ((ResultTy->getBitWidth() > 1) && Is this clang-format'

[PATCH] D38704: [libunwind] Emulate pthread rwlocks via SRW locks for windows

2017-10-14 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. I don't think we should depend on LLVM for the locking stuff. This sort of infrastructure is in the same bucket as the demangler which we haven't really solved. I *do* find it weird to do it this way though. I think you should have some mutex functions which include r

[PATCH] D38704: [libunwind] Abstract rwlocks into a class, provide a SRW lock implementation for windows

2017-10-23 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. LGTM https://reviews.llvm.org/D38704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43033: [WinEH] Put funclet bundles on inline asm calls

2018-02-07 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D43033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D43184: [WIP] [ItaniunCXXABI] Add an option for loading the type info vtable with dllimport

2018-02-12 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. Do I understand correctly that this workarounds a feature missing in lld? Does MinGW emit the same sorts of object files as clang in these scenarios? Repository: rC Clang https://reviews.llvm.org/D43184 ___ cfe-commits

[PATCH] D43576: Solution to fix PR27066 - Redefinition with same mangled name as another definition (dllexport and uuid)

2018-02-22 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. We should really, really avoid making this sort of change without first trying to desugar uuidof into a reference to a variable. That would solve a ton of problems, problems like this one. https://reviews.llvm.org/D43576

[PATCH] D43576: Solution to fix PR27066 - Redefinition with same mangled name as another definition (dllexport and uuid)

2018-02-22 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In https://reviews.llvm.org/D43576#1016418, @zahiraam wrote: > In https://reviews.llvm.org/D43576#1016295, @majnemer wrote: > > > We should really, really avoid making this sort of change without first > > trying to desugar uuidof into a reference to a variable. That wo

[PATCH] D43576: Solution to fix PR27066 - Redefinition with same mangled name as another definition (dllexport and uuid)

2018-02-22 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In https://reviews.llvm.org/D43576#1016512, @rsmith wrote: > Do we need to also track whether the argument is a pointer or reference to a > UUID (and also the cv-qualifiers)? For the `Declaration` case, we track this > by tracking the corresponding parameter type; the

[PATCH] D33616: [MS] Fix _bittest* intrinsics for values bigger than 31

2017-05-30 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. Do you really want to be doing signed division here? Because it is signed, it won't turn into the simple bitshifts and masks that one might expect. https://reviews.llvm.org/D33616 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D33616: [MS] Fix _bittest* intrinsics for values bigger than 31

2017-05-30 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In https://reviews.llvm.org/D33616#768287, @hans wrote: > From looking in the Intel manual (Table 3-2, in 3.1.1.9 about > Bit(BitBase,BitOffset)) it does sound like the bit offset can be negative > *shudder*, so I suppose this is necessary and explains why the type is

[PATCH] D33616: [MS] Fix _bittest* intrinsics for values bigger than 31

2017-05-30 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. LGTM https://reviews.llvm.org/D33616 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33616: [MS] Fix _bittest* intrinsics for values bigger than 31

2017-05-30 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: clang/lib/Headers/intrin.h:345-347 + _BitBase += (_BitPos / 32); + _BitPos %= 32; return (*_BitBase >> _BitPos) & 1; `_bittest` seems to expand to `(((unsigned char const *)_BitBase)[_BitPos >> 3] >> (_BitPos & 7

[PATCH] D33852: Enable __declspec(selectany) on linux

2017-06-04 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: include/clang/Basic/Attr.td:2421 -def SelectAny : InheritableAttr, TargetSpecificAttr { +def SelectAny : InheritableAttr, TargetSpecificAttr { let Spellings = [Declspec<"selectany">, GCC<"selectany">]; selectany sh

[PATCH] D32428: Fix for Itanium mangler issue with templates (bug: 31405)

2017-06-13 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D32428 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D34377: Support MS builtins using 'long' on Darwin/LP64

2017-06-20 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/AST/ASTContext.cpp:8551 + break; +} case 'W': bruno wrote: > bruno wrote: > > rnk wrote: > > > compnerd wrote: > > > > I agree with @majnemer. Why not base this on the Int64Type? > > > I'd suggest thi

[PATCH] D34523: AST: mangle BlockDecls under MS ABI

2017-06-22 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. Can you please have a test where you define blocks w/ static variables in several default arguments of the same function? Also would be good to have this in NSDMIs in class definitions. Repository: rL LLVM https://reviews.llvm.org/D34523

[PATCH] D34523: AST: mangle BlockDecls under MS ABI

2017-06-23 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/AST/MicrosoftMangle.cpp:981-984 + Out << "YAXPAU__block_literal"; + if (Discriminator) +Out<< '_' << Discriminator; + Out << "@@@Z"; I think you want to use mangleArtificalTagType here. Repo

[PATCH] D34523: AST: mangle BlockDecls under MS ABI

2017-06-23 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/AST/MicrosoftMangle.cpp:981-984 + Out << "YAXPAU__block_literal"; + if (Discriminator) +Out<< '_' << Discriminator; + Out << "@@@Z"; compnerd wrote: > majnemer wrote: > > I think you want to u

[PATCH] D34588: Check for _MSC_VER before define _LIBCPP_MSVCRT

2017-06-24 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: include/__config:234-235 +// a MS compatibility version is specified. # ifndef __MINGW32__ -#define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library +#ifdef _MSC_VER +# define _LIBCPP_MSVCRT // Using Microsoft's C Ru

[PATCH] D34523: AST: mangle BlockDecls under MS ABI

2017-06-24 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/AST/MicrosoftMangle.cpp:985 + + Out << '?' << Discriminate("_block_invoke", Discriminator) << '@'; + if (const auto *RD = dyn_cast(DC)) Should this be `Out << '?' << mangleSourceName(Discriminate("_block_i

[PATCH] D34523: AST: mangle BlockDecls under MS ABI

2017-06-25 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. We need tests that show that it does the right thing in blocks defined in classes in classes and other nested concepts. Comment at: lib/AST/MicrosoftMangle.cpp:980-981 + unsigned Discriminator = BD->getBlockManglingNumber(); + if (!Discrimin

[PATCH] D34523: AST: mangle BlockDecls under MS ABI

2017-06-25 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/AST/MicrosoftMangle.cpp:993-994 + Out << "YAX"; + // struct __block_literal * + Out << "PA"; + mangleArtificalTagType(TTK_Struct, compnerd wrote: > majnemer wrote: > > Shouldn't we also mangle an

[PATCH] D34523: AST: mangle BlockDecls under MS ABI

2017-06-26 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. Looks good to me but I definitely want to hear what @efriedma has to say. Repository: rL LLVM https://reviews.llvm.org/D34523 ___ cfe-comm

[PATCH] D44327: ObjCARC: teach the cloner about funclets

2018-03-09 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/Transforms/ObjCARC/ObjCARCOpts.cpp:701 + + if (auto *CleanupPad = dyn_cast(BB.getFirstNonPHI())) +OpBundles.emplace_back("funclet", CleanupPad); What if the cleanuppad was introduced in a block which branched t

[PATCH] D44327: ObjCARC: teach the cloner about funclets

2018-03-09 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. LGTM Comment at: lib/Transforms/ObjCARC/ObjCARCOpts.cpp:692 + DenseMap &BlockColors) { + auto *CI = dyn_cast(&I); + assert(CI && "CloneCallInst must r

[PATCH] D47875: [MS ABI] Mangle unnamed empty enums (PR37723)

2018-06-07 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/AST/MicrosoftMangle.cpp:888-891 auto EnumeratorI = ED->enumerator_begin(); -assert(EnumeratorI != ED->enumerator_end()); -Name += "getName(); +if (EnumeratorI == ED->enumerator_end()) { + Na

[PATCH] D47875: [MS ABI] Mangle unnamed empty enums (PR37723)

2018-06-08 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D47875 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D52499: [clang-cl] Make /Gs imply default stack probes, not /Gs0 (PR39074)

2018-09-25 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. FWIW, Microsoft's newest documentation does not say that `/O2` and `/O1` imply `/Gs`: https://docs.microsoft.com/en-us/cpp/build/reference/o1-o2-minimize-size-maximize-speed?view=vs-2017

[PATCH] D52384: [Sema] Fix redeclaration contexts for enumerators in C

2018-09-27 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/AST/DeclBase.cpp:1711-1712 + // contexts are always skipped. + while (SkipRecords ? Ctx->isTransparentContext() || Ctx->isRecord() + : Ctx->isTransparentContext()) Ctx = Ctx->getParent();

[PATCH] D37206: [ItaniumCXXABI] Always use linkonce_odr linkage for RTTI data on MinGW

2017-08-30 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D37206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D33852: Enable __declspec(selectany) on linux

2017-09-08 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: include/clang/Basic/AttrDocs.td:3154 + +def SelectAnyDocs : Documentation { + let Content = [{This attribute makes global symbol have a weak definition aaron.ballman wrote: > Prazek wrote: > > aaron.ballman wrote: > >

[PATCH] D37529: [codeview] omit debug locations for nested exprs unless column info enabled

2017-09-11 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.h:32 #include "clang/Basic/XRayLists.h" +#include "clang/Frontend/CodeGenOptions.h" #include "llvm/ADT/DenseMap.h" Any reason to do this? I'd just keep getNestedExpressionLocationsEnabl

[PATCH] D55715: Add AddressSpace mangling to MS mode

2018-12-14 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/AST/MicrosoftMangle.cpp:1806-1836 +Extra.mangleSourceName("AS_"); +Extra.mangleIntegerLiteral(llvm::APSInt::getUnsigned(TargetAS), + /*IsBoolean*/ false); + } else { +switch (AS) { +def

[PATCH] D55853: Ignore ConstantExpr in IgnoreParenNoopCasts

2018-12-18 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: clang/lib/AST/Expr.cpp:2722-2725 +if (ConstantExpr *CE = dyn_cast(E)) { + E = CE->getSubExpr(); + continue; +} Just curious, why not go even further and use FullExpr rather than ConstantExpr? CHANGES

[PATCH] D56391: Limit COFF 'common' emission to <=32 alignment types.

2019-01-07 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:3766 + // in common. + if (Context.getTargetInfo().getTriple().isOSBinFormatCOFF() && + Context.getTypeAlignIfKnown(D->getType()) > 32) I think this should be isKnownWindowsMSVCEnvir

[PATCH] D56466: [CodeGen] Clarify comment about COFF common symbol alignment

2019-01-08 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:3765-3766 + + // MSVC doesn't support alignments greater than 32 for common symbols, so + // symbols with greater alignment requirements cannot be common. Non-MSVC COFF + // environments support arbitra

[PATCH] D45738: Add Microsoft mangling for _Float16, similar to technique used for _Complex

2018-04-17 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. LGTM Repository: rL LLVM https://reviews.llvm.org/D45738 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi

[PATCH] D45839: [analyzer] Add support for WebKit "unified sources".

2018-04-20 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h:145-147 + if (Name.endswith_lower(".c") || Name.endswith_lower(".cpp") || + Name.endswith_lower(".cc") || Name.endswith_lower(".cxx") || + Name.en

[PATCH] D49354: [MinGW] Automatically mangle Windows-specific entry points as C

2018-07-15 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. LGTM Repository: rC Clang https://reviews.llvm.org/D49354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cg

[PATCH] D77777: [nvptx] Add `nvvm.texsurf.handle` internalizer.

2020-04-11 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In D7#1975618 , @hliao wrote: > In D7#1975406 , @tra wrote: > > > In D7#1975178 , @hliao wrote: > > > > > the 1st argument in `llvm.nvvm

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-06-03 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: clang/include/clang/AST/Stmt.h:1783 + + bool IsSideEntry() const { return SideEntry; } + void setSideEntry() { SideEntry = true; } I think this should be isSideEntry to be consistent. Comment at: cl

[PATCH] D83360: [InstSimplify] Remove select ?, undef, X -> X and select ?, X, undef -> X

2020-07-08 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4121-4125 - if (isa(TrueVal)) // select ?, undef, X -> X -return FalseVal; - if (isa(FalseVal)) // select ?, X, undef -> X -return TrueVal; - Can we still do these

[PATCH] D76077: [ARM] Add __bf16 as new Bfloat16 C Type

2020-05-14 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: clang/include/clang-c/Index.h:3254 CXType_FirstBuiltin = CXType_Void, CXType_LastBuiltin = CXType_ULongAccum, Should this be: CXType_LastBuiltin = CXType_BFloat16, Comment at: clang/lib/AST

[PATCH] D40023: [RISCV] Implement ABI lowering

2017-11-23 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. So how does something like the following work: union U { float f; int i; }; void f(union U u); The flattening described in https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#hardware-floating-point-calling-convention makes sense for arrays and s

[PATCH] D40023: [RISCV] Implement ABI lowering

2017-11-23 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In https://reviews.llvm.org/D40023#933466, @asb wrote: > In https://reviews.llvm.org/D40023#933464, @majnemer wrote: > > > So how does something like the following work: > > > > union U { float f; int i; }; > > void f(union U u); > > > > > > The flattening describ

[PATCH] D40071: [libcxx] Implement exception_ptr on Windows without msvcprt.dll

2017-12-04 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: src/support/runtime/exception_pointer_msvc.ipp:119-123 +#ifdef _M_AMD64 +RtlPcToFileHeader( +reinterpret_cast(const_cast(throw_info)), +&image_base); +#endif Can't you use the image_base field in thr

[PATCH] D41032: [CodeGen][X86] Implement _InterlockedCompareExchange128 intrinsic

2017-12-12 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp:8439 + +llvm::Type *Int128Ty = llvm::IntegerType::get(getLLVMContext(), 128); +llvm::Type *Int128PtrTy = Int128Ty->getPointerTo(); Builder.getInt128Ty() https://revie

[PATCH] D66836: [libc++] Add `__truncating_cast` for safely casting float types to integers

2019-08-28 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: test/libcxx/numerics/truncating_cast.pass.cpp:12 +// Test the conversion function that truncates floating point types to the +// closes representable value for the specified integer type, or +// numeric_limits::max()/min() if the value

[PATCH] D66827: Add support for MS qualifiers __ptr32, __ptr64, __sptr, __uptr.

2019-09-04 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: clang/lib/AST/MicrosoftMangle.cpp:1718 QualType PointeeType) { - if (PointersAre64Bit && - (PointeeType.isNull() || !PointeeType->isFunctionType())) + // Check if this is

[PATCH] D35782: [C++2a][Preprocessor] Implement p0306 __VA_OPT__ (Comma omission and comma deletion)

2017-08-20 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: include/clang/Lex/TokenLexer.h:169 + bool PasteTokens(Token &Tok, + llvm::ArrayRef AltTokens = llvm::ArrayRef(), + unsigned int *const AltCurTokenIdx = nullptr); I think `llvm::Array

[PATCH] D37035: Implement __builtin_LINE() et. al. to support source location capture.

2017-08-22 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: include/clang/AST/Expr.h:3816 +/// __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(), or +/// __BUILTIN_FILE() +class SourceLocExpr final : public Expr { __BUILTIN_FILE -> __builtin_FILE Comm

[PATCH] D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc

2017-08-22 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. I'd expect this to be more limited. Something like, "if we have a BinaryOperator of + between a CStyleCastExpr of NullToPointer and 'X', emit inttoptr(X)" https://reviews.llvm.org/D37042 ___ cfe-commits mailing list cfe-c

[PATCH] D37042: Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc

2017-08-22 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In https://reviews.llvm.org/D37042#849726, @majnemer wrote: > I'd expect this to be more limited. > > Something like, "if we have a BinaryOperator of + between a CStyleCastExpr of > NullToPointer and 'X', emit inttoptr(X)" Although maybe that is too strict... I guess

[PATCH] D88905: [Clang] Allow "ext_vector_type" applied to Booleans

2020-10-30 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:2782 + +// construct the vector of 'unsigned char' type +QualType CharVecTy = Ctx.getVectorType(Ctx.CharTy, NumVectorBytes, The code as written seems to be 'char' type, not 'uns

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-27 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:12452 +int Ilogb; +if (APFloat::opStatus St = ilogb(F, Ilogb); !isConstantOpStatus(St)) + return false; Izaron wrote: > jcranmer-intel wrote: > > Izaron wrote: > > > aaron.bal

[PATCH] D141347: Remove the ThreadLocal template from LLVM.

2023-01-09 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. LGTM Comment at: llvm/lib/Support/CrashRecoveryContext.cpp:23 struct CrashRecoveryContextImpl; - -sys::ThreadLocal &getCurrentContext() { - static sys::ThreadLocal Curr

[PATCH] D44931: [WebAssembly] Use Windows EH instructions for Wasm EH

2018-03-27 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. Some quick first pass comments. Comment at: lib/CodeGen/CGCleanup.cpp:985 +// does not have a runtime support for that. +if (!Personality.usesFuncletPads() || Personality.isWasmPersonality()) { + EHStack.pushTerminate(); I

[PATCH] D45112: [MS] Emit vftable thunks for functions with incomplete prototypes

2018-03-30 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. Does this help PR25641? https://reviews.llvm.org/D45112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45174: non-zero-length bit-fields should make a class non-empty

2018-04-02 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In https://reviews.llvm.org/D45174#1055125, @rsmith wrote: > In https://reviews.llvm.org/D45174#1055048, @rsmith wrote: > > > I wonder if we can delete the `getNonVirtualSize()` check now -- I don't > > see any way that an empty class can have a nonzero nvsize except by

[PATCH] D39347: Fix __has_unique_object_representations based on rsmith's input

2017-11-14 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. It'd be good to have tests which have alignment directives on bitfields. https://reviews.llvm.org/D39347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D40218: [Clang] Add __builtin_launder

2017-11-19 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. A test with restrict and __restrict might be interesting. https://reviews.llvm.org/D40218 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D146441: [APFloat] Add E4M3B11FNUZ

2023-03-20 Thread David Majnemer via Phabricator via cfe-commits
majnemer created this revision. majnemer added a reviewer: reedwm. Herald added subscribers: Moerafaat, zero9178, bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagains

[PATCH] D146441: [APFloat] Add E4M3B11FNUZ

2023-03-20 Thread David Majnemer via Phabricator via cfe-commits
majnemer updated this revision to Diff 506694. majnemer added a comment. Fix a small typo in PyFloat8E4M3B11FNUZType Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146441/new/ https://reviews.llvm.org/D146441 Files: clang/lib/AST/MicrosoftMangle.

[PATCH] D146441: [APFloat] Add E4M3B11FNUZ

2023-03-24 Thread David Majnemer via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2f086f265bf9: [APFloat] Add E4M3B11FNUZ (authored by majnemer). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D146441: [APFloat] Add E4M3B11FNUZ

2023-03-25 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: clang/lib/AST/MicrosoftMangle.cpp:848 case APFloat::S_Float8E4M3FNUZ: + case APFloat::S_Float8E4M3B11FNUZ: llvm_unreachable("Tried to mangle unexpected APFloat semantics"); aaron.ballman wrote: > Why are there

[PATCH] D151923: [APFloat] Add APFloat semantic support for TF32

2023-06-02 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: llvm/include/llvm/ADT/APFloat.h:190 +// greater throughput than single precision (32-bit) formats. +S_FloatTF32, Hmm, this says improved precision than half but the semantics you gave say 11 digits? Does NVI

[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation

2016-12-15 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. My 2 cents: If making this a target-specific default is not OK, why not turn on -fno-strict-return if -fapple-kext is specified? I believe that would cover the critical use case in question. Repository: rL LLVM https://reviews.llvm.org/D27163 ___

[PATCH] D27641: DebugInfo: Added support for Checksum debug info feature (Clang part)

2016-12-18 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CGDebugInfo.cpp:433-434 void CGDebugInfo::CreateCompileUnit() { + SmallString<32> Checksum; + llvm::DIFile::ChecksumKind CSKind = llvm::DIFile::CSK_None; Formatting looks wrong https://reviews.llvm.o

[PATCH] D28212: typeinfo: provide a partial implementation for Win32

2017-01-01 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: src/typeinfo.cpp:28-29 +#if defined(_WIN64) + static constexpr const size_t fnv_offset_basis = 14695981039346656037; + static constexpr const size_t fnv_prime = 10995116282110; +#else majnemer wrote: > Why make these

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. slim reader-writer locks are faster than critical sections, I'd recommend your implementation switch to those. Also, why do you use Fls instead of Tls? Repository: rL LLVM https://reviews.llvm.org/D28220 ___ cfe-commit

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In https://reviews.llvm.org/D28220#633622, @compnerd wrote: > @majnemer Im using the Fls* APIs since they provide the thread termination > callback, which Tls* doesn't. Good point about the SRW. Those are newer, > but, we can always provide a fallback later. I don'

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: include/__threading_support:300-305 +int __libcpp_recursive_mutex_init(__libcpp_mutex_t *__m) +{ + InitializeSRWLock(__m); + return 0; +} + I don't think you can use slim rw locks for recursive locks. I think we will

[PATCH] D28220: provide Win32 native threading

2017-01-02 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: include/__threading_support:300-305 +int __libcpp_recursive_mutex_init(__libcpp_mutex_t *__m) +{ + InitializeSRWLock(__m); + return 0; +} + compnerd wrote: > majnemer wrote: > > I don't think you can use slim rw locks

[PATCH] D28226: threading_support: introduce __libcpp_recursive_mutex_t

2017-01-03 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. Is `__libcpp_mutex_reference` all that useful? There is no real dynamism for these mutexes. I'd just add functions for the recursive locks just like we have a separate function for `__libcpp_recursive_mutex_init` Repository: rL LLVM https://reviews.llvm.org/D28226

[PATCH] D28226: threading_support: introduce __libcpp_recursive_mutex_t

2017-01-03 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In https://reviews.llvm.org/D28226#634282, @compnerd wrote: > The dynamic behavior only is used for Windows, not pthreads. So, we dont see > it here, but it becomes apparent in the windows support. I was trying to > minimize the changes to libc++ itself to avoid havi

[PATCH] D28383: build: add a heuristic to determine the C++ ABI

2017-01-05 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. Why isn't this equivalent to `_MSC_VER` ? Repository: rL LLVM https://reviews.llvm.org/D28383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28220: provide Win32 native threading

2017-01-06 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: include/__threading_support:29-30 +#include +#define WIN32_LEAN_AND_MEAN +#include +#include EricWF wrote: > I think we agreed that we cannot use this macro. Can we do as Reid suggests and not expose users to windows

[PATCH] D28788: [AST] AttributedType should derive type properties from the EquivalentType

2017-01-16 Thread David Majnemer via Phabricator via cfe-commits
majnemer created this revision. Using the canonical type instead of the equivalent type can result in insufficient template instantiations. This fixes PR31656. https://reviews.llvm.org/D28788 Files: include/clang/AST/Type.h test/CodeGenCXX/microsoft-abi-default-cc.cpp Index: test/CodeGen

[PATCH] D28788: [AST] AttributedType should derive type properties from the EquivalentType

2017-01-16 Thread David Majnemer via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292194: [AST] AttributedType should derive type properties from the EquivalentType (authored by majnemer). Changed prior to commit: https://reviews.llvm.org/D28788?vs=84609&id=84625#toc Repository: r

[PATCH] D34714: [MS] Don't statically initialize dllimport member function pointers

2017-06-27 Thread David Majnemer via Phabricator via cfe-commits
majnemer created this revision. r306137 made dllimport pointers to member functions non-constant. This is correct because a load must be executed to resolve any dllimported data. However, r306137 did not account for the use of dllimport member function pointers used as template arguments. This ch

[PATCH] D34714: [MS] Don't statically initialize dllimport member function pointers

2017-06-27 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. In https://reviews.llvm.org/D34714#793205, @rnk wrote: > Did you locally add a test case for the dllimport member function pointer > template argument? Arg, yes. Forgot to add the file... Comment at: lib/Sema/SemaTemplate.cpp:5704 + else +NPV

[PATCH] D35180: Expose the Clang::QualType to llvm::Type conversion functions

2017-07-09 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/CodeGenABITypes.cpp:71 + assert(FD != nullptr && "Expected a non-null function declaration!"); + llvm::Type* T = CGM.getTypes().ConvertFunctionType(FD->getType(), FD); + Pointers lean right.

[PATCH] D35472: Implement P0463R1: "Endian just Endian"

2017-07-17 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: test/std/utilities/meta/meta.type.synop/endian.pass.cpp:39-42 +union { +uint32_t i; +char c[4]; +} u = {0x01020304}; This is undefined behavior as-is because you are reading from a union member

[PATCH] D35715: Preserve typedef names in debug info for template type parameters

2017-07-21 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. This might be a silly question but why not do this by default? https://reviews.llvm.org/D35715 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34972: [CodeGen] Propagate dllexport to thunks

2017-07-21 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. OK, so we are exporting the thunks so that the linker will generate import thunks for the thunks. I think that we should have a comment to that effect near the code you added. https://reviews.llvm.org/D34972 ___ cfe-commi

[PATCH] D34972: [CodeGen] Propagate dllexport to thunks

2017-07-24 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D34972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-24 Thread David Majnemer via Phabricator via cfe-commits
majnemer created this revision. std::byte, when defined as an enum, needs to be given special treatment with regards to its aliasing properties. An array of std::byte is allowed to be used as storage for other types. This fixes PR33916. https://reviews.llvm.org/D35824 Files: lib/Sema/SemaDec

[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-25 Thread David Majnemer via Phabricator via cfe-commits
majnemer updated this revision to Diff 108105. majnemer added a comment. - Address review feedback. https://reviews.llvm.org/D35824 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/CodeGen/CodeGenTBAA.cpp test/CodeGenCXX/std-byte.cpp Index: test/CodeGenCXX/std-byte.cpp ===

[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-25 Thread David Majnemer via Phabricator via cfe-commits
majnemer updated this revision to Diff 108166. majnemer added a comment. - Address review comments https://reviews.llvm.org/D35824 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/CodeGen/CodeGenTBAA.cpp test/CodeGenCXX/std-byte.cpp Index: test/CodeGenCXX/std-byte.cpp

[PATCH] D35824: [Sema] Implicitly apply the may_alias attribute to std::byte

2017-07-25 Thread David Majnemer via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309058: [CodeGen] Correctly model std::byte's aliasing properties (authored by majnemer). Changed prior to commit: https://reviews.llvm.org/D35824?vs=108166&id=108185#toc Repository: rL LLVM https:/

[PATCH] D35538: [CodeGen][ARM] ARM runtime helper functions are not always soft-fp

2017-07-25 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/CodeGen/TargetInfo.cpp:5625 + // The Run-time ABI for the ARM Architecture section 4.1.2 requires + // AEABI-complying FP helper functions to use the base AAPCS + // These AEABI functions are expanded in the ARM llvm backend, all

[PATCH] D42248: [LangOpts] Add a LangOpt to represent "#pragma region" support.

2018-01-18 Thread David Majnemer via Phabricator via cfe-commits
majnemer added a comment. Why not always support the pragma regardless of the compiler mode? Our "support" for it just ignores it anyway... https://reviews.llvm.org/D42248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.or

[PATCH] D42343: [coroutines] Fix application of NRVO to Coroutine "Gro" or return object.

2018-01-20 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: test/CodeGenCoroutines/coro-gro-nrvo.cpp:17 +using SizeT = decltype(sizeof(int)); +void* operator new(SizeT __sz, const std::nothrow_t&) noexcept; +void operator delete(void* __p, const std::nothrow_t&) noexcept; `Size

[PATCH] D42508: AST: support protocol conformances on id/class/interfaces in MS ABI

2018-01-24 Thread David Majnemer via Phabricator via cfe-commits
majnemer added inline comments. Comment at: lib/AST/MicrosoftMangle.cpp:2459-2465 + if (T->isObjCId()) +mangleSourceName("objc_object"); + else if (T->isObjCClass()) +mangleSourceName("objc_class"); + else +mangleSourceName(T->getInterface()->getName()); +

[PATCH] D42248: Always allow "#pragma region".

2018-01-25 Thread David Majnemer via Phabricator via cfe-commits
majnemer accepted this revision. majnemer added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D42248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

  1   2   >