Advertisement
Guest User

code in context

a guest
May 28th, 2021
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. bool Generic_GCC::addGCCLibStdCxxIncludePaths(
  2. const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args,
  3. StringRef DebianMultiarch) const {
  4. assert(GCCInstallation.isValid());
  5.  
  6. // By default, look for the C++ headers in an include directory adjacent to
  7. // the lib directory of the GCC installation. Note that this is expect to be
  8. // equivalent to '/usr/include/c++/X.Y' in almost all cases.
  9. StringRef LibDir = GCCInstallation.getParentLibPath();
  10. StringRef InstallDir = GCCInstallation.getInstallPath();
  11. StringRef TripleStr = GCCInstallation.getTriple().str();
  12. const Multilib &Multilib = GCCInstallation.getMultilib();
  13. const GCCVersion &Version = GCCInstallation.getVersion();
  14.  
  15. // Try /../$triple/include/c++/$version then /../include/c++/$version.
  16. if (addLibStdCXXIncludePaths(
  17. LibDir.str() + "/../" + TripleStr + "/include/c++/" + Version.Text,
  18. TripleStr, Multilib.includeSuffix(), DriverArgs, CC1Args))
  19. return true;
  20. // Detect Debian g++-multiarch-incdir.diff.
  21. StringRef DebianMultiarch =
  22. GCCInstallation.getTriple().getArch() == llvm::Triple::x86
  23. ? "i386-linux-gnu"
  24. : TripleStr;
  25. if (addLibStdCXXIncludePaths(LibDir.str() + "/../include/c++/" + Version.Text,
  26. DebianMultiarch, Multilib.includeSuffix(),
  27. DriverArgs, CC1Args, /*Debian=*/true))
  28. return true;
  29.  
  30. if (addLibStdCXXIncludePaths(LibDir.str() + "/../include/c++/" + Version.Text,
  31. TripleStr, Multilib.includeSuffix(),
  32. DriverArgs, CC1Args, /*Debian=*/true))
  33. return true;
  34.  
  35. // Otherwise, fall back on a bunch of options which don't use multiarch
  36. // layouts for simplicity.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement