[PATCH] D55134: [CTU] Add triple/lang mismatch handling

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 4 12:11:04 PST 2018


martong marked 2 inline comments as done.
martong added inline comments.


================
Comment at: lib/CrossTU/CrossTranslationUnit.cpp:212
+    // diagnostics.
+    Context.getDiagnostics().Report(diag::err_ctu_incompat_triple)
+        << Unit->getMainFileName() << TripleTo.str() << TripleFrom.str();
----------------
xazax.hun wrote:
> martong wrote:
> > xazax.hun wrote:
> > > I think we should not emit an error here. It should be up to the caller (the user of the library) to decide if she wants to handle this as an error, warnings, or just suppress these kinds of problems. I would rather extend `emitCrossTUDiagnostics` as a shorthand for the user if emitting an error is the desired behavior.
> >  I would prefer to exploit the capabilities of the `DiagEngine`, instead of extending the interface of `CrossTranslationUnitContext`.
> > By using a `DiagGroup` we can upgrade the warning to be an error, so I just changed it to be like that.
> You do not need the extend the interface. There is already a function for that below. Also, the user might not want to display a warning either but do something else, like generate a log message. 
Ah, okay, I missed that. Now I added a case to that function. Still, I think having a `DiagGroup` is useful anyway.


Repository:
  rC Clang

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

https://reviews.llvm.org/D55134





More information about the cfe-commits mailing list