jamieschmeiser requested changes to this revision.
jamieschmeiser added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/Driver/ToolChains/Arch/PPC.cpp:54
+    auto TargetCPUName = llvm::StringSwitch<llvm::StringRef>(CPUName)
+                             .Case("common", "generic")
+                             .Case("440fp", "440")
----------------
This seems strange.  If the option is "generic", it calls 
getPPCGenericTargetCPU(), but if it is "common", it returns "generic."  I think 
you may want to also call getPPCGenericTargetCPU() here.  There should probably 
also be an assume where this returns that it didn't return "generic" if that is 
the intended result.  Also, there should also be tests for what happens when 
"generic" and "common" are specified.


================
Comment at: clang/lib/Driver/ToolChains/Arch/PPC.cpp:77
+                             .Default(CPUName);
+    return TargetCPUName.str();
   }
----------------
Why did you change the type from const char *?  Couldn't you use 
CPUName->data() in the default instead?  With your change, I think it may need 
to create StringRefs around all of the choices and then just get the string 
from them.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139720/new/

https://reviews.llvm.org/D139720

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to