Beispiel #1
0
def _detect_apple_llvm_options(command):
    output = get_output([command, "--help"])
    match = re.findall(_find_apple_llvm_options, output)
    options = []
    for m in match:
        options.append({"name": m[0], "paremeter": m[4], "description": m[5]})
    return options
Beispiel #2
0
def _detect_clang_version(command, out=None):
  output = get_output([command, "--version"])
  match = re.search(_clang_version_pattern, output)
  if not match:
    out.warning("[clg2]  {}: could not find version string".format(command))
    out.debug("[clg2] {}: {}".format(command, output))
    return "unknown"
  return match.group(1)
Beispiel #3
0
def _detect_apple_llvm_version(command, out=None):
    output = get_output([command, "--version"])
    match = re.search(_find_apple_llvm_version, output)
    if not match:
        if out:
            out.trace("[appl] {} is not Apple LLVM compiler".format(command))
        return None
    return match.group(1)
Beispiel #4
0
def _is_it_really_clang(command, patterns, out=None):
  for pattern in patterns:
    if re.search(pattern, command):
      output = get_output([command, "--version"])
      if _is_it_clangc2(output):
        return True
      else:
        out.trace("[clg2] {}: It is not ClangC2. Aborting.".format(command))
  return False
Beispiel #5
0
def _is_it_really_clang(command, patterns, out=None):
    for pattern in patterns:
        if re.search(pattern, command):
            output = get_output([command, "--version"])
            if not _is_it_different_clang(
                    output, [_apple_llvm_pattern, _clangc2_pattern]):
                return True
            else:
                out.trace(
                    "[clng] {}: It is not vanilla Clang (e.g. Apple, or ClangC2). Aborting."
                    .format(command))
    return False
Beispiel #6
0
def _is_it_clang_in_gcc_clothing(command):
    output = get_output([command, "--version"])
    match = re.search(_apple_llvm_pattern, output)
    if match:
        return True
    return False