[clang] Make the script create the absolute path rather than Ocaml. Fixes issues with symbolic links

master
Dulma Rodriguez 10 years ago
parent 6a36b9f70c
commit b57ac1fe49

@ -131,6 +131,7 @@ if [ -n "$ATTACH_PLUGIN" ]; then
if [ -n "$LANGUAGE" ]; then INFER_FRONTEND_ARGS+=("-x" "$LANGUAGE"); fi if [ -n "$LANGUAGE" ]; then INFER_FRONTEND_ARGS+=("-x" "$LANGUAGE"); fi
if [ "$FOBJC_ARC_FLAG" == 0 ]; then INFER_FRONTEND_ARGS+=("-fobjc-arc"); fi if [ "$FOBJC_ARC_FLAG" == 0 ]; then INFER_FRONTEND_ARGS+=("-fobjc-arc"); fi
[[ "$SOURCE_FILE" = /* ]] || { SOURCE_FILE="${CWD}/$SOURCE_FILE"; }
INFERCLANG_CMD=( INFERCLANG_CMD=(
"${BIN_DIR}/InferClang" "${BIN_DIR}/InferClang"
"-c" "$SOURCE_FILE" "-c" "$SOURCE_FILE"

@ -20,20 +20,18 @@ let init_curr_source_file source_file =
current_source_file := source_file current_source_file := source_file
let source_file_from_path path = let source_file_from_path path =
let path = Utils.filename_to_absolute path in if Filename.is_relative path then
(Logging.out
"ERROR: Path %s is relative. Please pass an absolute path in the -c argument.@."
path;
exit 1);
match !Config.project_root with match !Config.project_root with
| Some root -> | Some root ->
(try (try
DB.rel_source_file_from_abs_path root path DB.rel_source_file_from_abs_path root path
with DB.Path_not_prefix_root -> with DB.Path_not_prefix_root ->
DB.source_file_from_string path) DB.source_file_from_string path)
| None -> | None -> DB.source_file_from_string path
if (Filename.is_relative path) then
(Logging.out
"ERROR: Path %s is relative. Please pass either a project root or an absolute path in the -c argument.@."
path;
exit(1))
else (DB.source_file_from_string path)
let choose_sloc sloc1 sloc2 prefer_first = let choose_sloc sloc1 sloc2 prefer_first =
let sloc_bad sloc = let sloc_bad sloc =

Loading…
Cancel
Save