[PATCH] D40682: [driver] Set the 'simulator' environment for Darwin when -m<os>simulator-version-min is used

Bob Wilson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 4 18:04:14 PST 2017


bob.wilson accepted this revision.
bob.wilson added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/Driver/ToolChains/Darwin.cpp:1457-1465
   if (iOSVersion && (getTriple().getArch() == llvm::Triple::x86 ||
                      getTriple().getArch() == llvm::Triple::x86_64))
     Platform = IPhoneOSSimulator;
   if (TvOSVersion && (getTriple().getArch() == llvm::Triple::x86 ||
                       getTriple().getArch() == llvm::Triple::x86_64))
     Platform = TvOSSimulator;
   if (WatchOSVersion && (getTriple().getArch() == llvm::Triple::x86 ||
----------------
bob.wilson wrote:
> arphaman wrote:
> > bob.wilson wrote:
> > > These checks should set the simulator target as well.
> > This would break the `__APPLE_EMBEDDED_SIMULATOR__` macro, as that has to be specified only when is used `-m(iphone|tv|watch)simulator-version-min`. Or should we still set `__APPLE_EMBEDDED_SIMULATOR__` in the driver and allow `-simulator` even without `-m(iphone|tv|watch)simulator-version-min`?
> The intention is that using a target triple with "simulator" in the environment should replace the use of -m*simulator-version-min.
Alex pointed out to me that the subsequent call to setTarget takes care of setting the triple, so this is already doing what I wanted.


Repository:
  rC Clang

https://reviews.llvm.org/D40682





More information about the cfe-commits mailing list