diff options
author | Jason Molenda <jmolenda@apple.com> | 2014-11-21 02:25:15 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2014-11-21 02:25:15 +0000 |
commit | c6127dd6530d523fc004163496690105c8728af4 (patch) | |
tree | 67365bec7dfd307e99c8d285766c0ec8077fac5d /clang/lib/Serialization/ModuleManager.cpp | |
parent | 12d36309c924f7bec2ed2540f9da618eb404a34c (diff) | |
download | bcm5719-llvm-c6127dd6530d523fc004163496690105c8728af4.tar.gz bcm5719-llvm-c6127dd6530d523fc004163496690105c8728af4.zip |
Change CommandObjectTargetModulesLoad so that the filename argument
is treated as a string instead of a FileSpec.
OptionValueFileSpec::SetValueFromCString() passes the c string to
FileSpec::SetFile(str, true /* resolve */) - and with Zachary's
changes to FileSpec we're using llvm::sys::fs::make_absolute() to
do that "resolve" action now, where we used to use realpath().
One important difference between llvm::sys::fs::make_absolute and
realpath is that when they're handed a filename (no directory),
realpath prepends the current working directory *and if the file exists*,
returns that full path. If that file doesn't exist, the caller
uses the basename only.
llvm::sys::fs::make_absolute prepends the current working directory
regardless of whether it exists or not.
I considered having FileSpec::SetFile save the initial pathname,
call FileSpec::Resolve, and then check to see if the Resolve return
path exists - and if not, go back to the original one.
But instead I just went with changing 'target modules load' to treat its
filename argument as a string instead of a FileSpec. This brings it
in line with how 'target modules list' works.
<rdar://problem/18955416>
llvm-svn: 222498
Diffstat (limited to 'clang/lib/Serialization/ModuleManager.cpp')
0 files changed, 0 insertions, 0 deletions