[PATCH] D16488: Fix getCompiler in unit testing framework on compiler symlinks
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 22 15:05:35 PST 2016
zturner added inline comments.
================
Comment at: packages/Python/lldbsuite/test/plugins/builder_base.py:30-39
@@ -26,1 +29,12 @@
+ compiler = os.environ["CC"]
+ if "gcc" in compiler or "clang" in compiler:
+ return compiler
+
+ version = check_output([compiler, "-v"], stderr=STDOUT);
+ if version.find("clang") != -1:
+ return "clang"
+ if version.find("gcc") != -1:
+ return "gcc"
+
+ return compiler
----------------
This works, but I think it could be better. It sounds like what you really want to do is resolve the symlink. What about this:
def getCompiler():
compiler = os.environ.get("CC", "clang")
return os.path.realpath(compiler)
http://reviews.llvm.org/D16488
More information about the llvm-commits
mailing list