Open rgov opened 10 years ago
Hi rgov, C-Reduce operates (mostly) at the syntax level, and Objective C is very similar to C/C++ at this level. Therefore, C-Reduce should reduce Objective C perfectly well right out of the box. Could you please give this us a try and let us know how it works? If it does not work (that is, it does not do a good job reduction) please send us a test case and we'll look into it.
Please re-open. The code explicitly prevents processing Objective-C and Objective-C++ and results in the error message above, due to this code in the TransformationManager:
if ((IK == IK_C) || (IK == IK_PreprocessedC)) {
...
else if ((IK == IK_CXX) || (IK == IK_PreprocessedCXX)) {
...
else {
ErrorMsg = "Unsupported file type!";
return false;
}
If these languages are supported, then it should also check for IK_ObjC
, IK_ObjCXX
, and the preprocessed forms of each.
Although it seems like an easy change, I haven't tried patching the code to address this case myself, and I do not have a test suite of Objective-C features to see if there are any that cause problems for the reduction.
Ok, but since none of us do any ObjC development I doubt we'll get around to this. The rest of C-Reduce should work just fine for reducing ObjC, yes?
Does anyone have time to try to support ObjC here? Do you @rgov? It doesn't look like probably very much code is required. clang_delta might crash like crazy on objc but perhaps it'll accomplish something...
@rgov have you tried using C-Reduce on Objective C and ignoring any errors that it reports? My guess is this works decently well but I'd like confirmation.
I'd be interested in doing what I can to help see this added; I'd have to learn the creduce codebase and become a better programmer first though.
Seems that only C and C++ are supported right now.