bkelley marked an inline comment as done.
bkelley added inline comments.

================
Comment at: lib/Sema/SemaCast.cpp:125
+      assert(Self.getLangOpts().ObjCAutoRefCount ||
+             Self.getLangOpts().ObjCWeak);
 
----------------
rjmccall wrote:
> Unlike the other patches, we do clearly need to be checking the language 
> options in places like this.  Still, it's a shame to repeat the same 
> condition in a million places.
> 
> I think the right thing to do here is to add a helper method to LangOpts:
> 
>   /// Returns true if any types in the program might have non-trivial 
> lifetime qualifiers.
>   bool allowsNonTrivialObjCLifetimeQualifiers() const {
>     return ObjCAutoRefCount || ObjCWeak;
>   }
Thanks for the suggestion. I was hesitant to add a method to LangOpts since it 
has so few derived state functions, but it certainly makes everything else 
cleaner.


https://reviews.llvm.org/D31006



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

Reply via email to