Can I suggest using `getNumOccurrences()` once again? if (BuildPath.getNumOccurrences() > 0) // -p specified else // -p not specified http://llvm.org/docs/doxygen/html/classllvm_1_1cl_1_1Option.html#add4bb5355441c007e7ed0e374f221040 http://llvm-reviews.chandlerc.com/D1337