MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / find_profdata

Function find_profdata

scripts/memwaste-scaling.py:46–60  ·  view source on GitHub ↗
(cc: str)

Source from the content-addressed store, hash-verified

44
45
46def find_profdata(cc: str) -> str:
47 cc_path = shutil.which(cc)
48 if cc_path:
49 cand = os.path.join(os.path.dirname(os.path.realpath(cc_path)), "llvm-profdata")
50 if os.access(cand, os.X_OK):
51 return cand
52 for name in ("llvm-profdata",) + tuple(f"llvm-profdata-{v}" for v in range(30, 13, -1)):
53 p = shutil.which(name)
54 if p:
55 return p
56 if shutil.which("xcrun"):
57 res = subprocess.run(["xcrun", "--find", "llvm-profdata"], capture_output=True, text=True, check=False)
58 if res.returncode == 0 and res.stdout.strip():
59 return res.stdout.strip()
60 sys.exit("memwaste-scaling: llvm-profdata not found next to the compiler or on PATH")
61
62
63def replicate(src: str, dst: str, copies: int) -> int:

Callers 1

mainFunction · 0.85

Calls 2

rangeFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected