kparzysz-quic commented on code in PR #12440:
URL: https://github.com/apache/tvm/pull/12440#discussion_r949674103


##########
src/target/llvm/llvm_instance.cc:
##########
@@ -153,6 +176,21 @@ LLVMTarget::LLVMTarget(LLVMInstance& instance, const 
Target& target)
     }
   }
 
+  if (const Optional<Array<String>>& v = 
target->GetAttr<Array<String>>("cl-opt")) {
+    llvm::StringMap<llvm::cl::Option*>& options = 
llvm::cl::getRegisteredOptions();
+    for (const String& s : v.value()) {
+      Option opt = ParseOptionString(s);
+      if (opt.type == Option::OptType::Invalid) {
+        continue;
+      }
+      if (options.count(opt.name)) {
+        llvm_options_.push_back(opt);
+      } else {
+        LOG(WARNING) << "\"" << opt.name << "\" is not an LLVM option, option 
ignored";

Review Comment:
   Sure, I can change the warnings to errors.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to