environment
Change-Id: I5e29abefacef0f25e44cf4d3f030a8ba762586d2
/// command line.
std::string Dir;
+ /// The real path the driver executable was in, as invoked from the
+ /// command line. It differs from Dir in case of accelerated environment.
+ std::string RealDir;
+
/// The original path to the clang executable.
std::string ClangExecutable;
if (!this->VFS)
this->VFS = llvm::vfs::getRealFileSystem();
+ RealDir = llvm::sys::path::parent_path(ClangExecutable);
+
// Skip /emul if we work in accelerated environment
#define QEMU_ACCEL_DIR "/emul"
if (ClangExecutable.substr(0, sizeof(QEMU_ACCEL_DIR) - 1) == QEMU_ACCEL_DIR)
#endif
SmallString<1024> Plugin;
- llvm::sys::path::native(Twine(D.Dir) +
+ llvm::sys::path::native(Twine(D.RealDir) +
"/../" CLANG_INSTALL_LIBDIR_BASENAME +
PluginName + Suffix,
Plugin);