add support for opt's '-passes foo' syntax (no =)
MODIFY
llvm_util/known_fns.cpp
llvm_util/known_fns.cpp
@@ -429,11 +429,10 @@ known_call(llvm::CallInst &i, const llvm::TargetLibraryInfo &TLI,
}
// calloc
- if (decl && decl->getName() == "calloc") {
-
+ if (decl && decl->getName() == "calloc")
RETURN_VAL(make_unique<Calloc>(*ty, value_name(i), *args[0], *args[1],
std::move(attrs)));
- }
+
// malloc or new
RETURN_VAL(
make_unique<Malloc>(*ty, value_name(i), *args[0], std::move(attrs)));

MODIFY
scripts/opt-alive.sh.in
scripts/opt-alive.sh.in
@@ -28,9 +28,22 @@ done
# opt enables NPM by default.
NPM_TV=1
+SKIP_ARG=0
+
for arg in $@; do
# update the -passes argument only.
shift
+
+ if [[ $SKIP_ARG == 1 ]]; then
+ SKIP_ARG=0
+ continue
+ fi
+
+ if [[ $arg == "-passes" || $arg == "--passes" ]]; then
+ arg="-passes=$1"
+ SKIP_ARG=1
+ fi
+
if [[ $arg == "-passes="* || $arg == "--passes="* ]]; then
TV=""
passes=${arg/-*passes=/}

add support for opt's '-passes foo' syntax (no =)