[PATCH] D124702: [MSVC] Add support for pragma function
Stephen Long via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 6 12:06:18 PDT 2022
steplong added inline comments.
================
Comment at: clang/lib/Sema/SemaAttr.cpp:1079
+ MSFunctionNoBuiltins.insert(MSFunctionNoBuiltins.end(),
+ NoBuiltins.begin(), NoBuiltins.end());
+}
----------------
hans wrote:
> steplong wrote:
> > hans wrote:
> > > Do we want to avoid duplicates in MSFunctionNoBuiltins? Or maybe it doesn't matter?
> > Yea, I didn't think it really mattered. I originally wanted to use a set, but I needed the strings to be stored in contiguous memory for NoBuitinAttr::CreateImplicit() in Sema::AddRangeBasedNoBuiltin()
> A set would be nicer conceptually of course.
>
> How about using an llvm::SmallSetVector. That will solve the problem of duplicates, it will be deterministic, and you can use getArrayRef() to get the values in contiguous memory, or maybe being() and end() will work too.
Hmm do you know where I can find an Allocator? getArrayRef().data() returns a pointer to a constant StringRef, but CreateImplicit takes a pointer to a StringRef.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124702/new/
https://reviews.llvm.org/D124702
More information about the cfe-commits
mailing list