[PATCH] D20136: Get default -fms-compatibility-version from cl.exe's version

Adrian McCarthy via cfe-commits cfe-commits at lists.llvm.org
Fri May 13 11:43:17 PDT 2016


amccarth marked an inline comment as done.

================
Comment at: lib/Driver/MSVCToolChain.cpp:481
@@ +480,3 @@
+
+  std::vector<uint8_t> VersionBlock(VersionSize);
+  if (!::GetFileVersionInfoW(ClExeWide.c_str(), 0, VersionSize,
----------------
majnemer wrote:
> amccarth wrote:
> > majnemer wrote:
> > > It might be nicer to use a `SmallVector<uint8_t, sizeof(VS_FIXEDFILEINFO)>`, or whatever `VersionSize` typically is, here to avoid heap allocation in the common case.
> > What's the cutoff for "small"?  The version block in cl.exe is about 9KB.
> Using 10K is probably fine, the default stack size on Windows is a massive 1 MB and this function is not reentrant.
My mistake.  It's a smidge over 1KB, (still more than sizeof(VS_FIXEDFILEINFO)) so I've make a SmallVector of 2KB.


http://reviews.llvm.org/D20136





More information about the cfe-commits mailing list