> The code in the Driver happens before Compilation is created.
> I took care of this duplication of code by initializing a field in Compilation
> with the value that we computed in the Driver::SysRoot field.

That should work.

+    TranslatedArgs(_TranslatedArgs), Redirects(0), SysRoot(D.SysRoot)

Is this value of SysRoot ever used? It should not, right? It is
probably better to initialize SysRoot with an invalid value instead of
D.SysRoot.

  if (SysRoot != "") {
+    llvm::SmallString<128> Prefix(SysRoot);
+    if (Prefix.back() == '/') {
+      llvm::sys::path::remove_filename(Prefix); // remove the /
+      SysRoot = Prefix.str();
+    }
+  }

This points a StringRef to a value that is destroyed at the closing brace.

Cheers,
Rafael
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to