[PATCH] D55132: [CTU] Add asserts to protect invariants

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 4 05:56:45 PST 2018


xazax.hun accepted this revision.
xazax.hun added inline comments.


================
Comment at: lib/CrossTU/CrossTranslationUnit.cpp:249
 CrossTranslationUnitContext::importDefinition(const FunctionDecl *FD) {
+  assert(FD->hasBody() && "Functions to be imported should have body.");
+
----------------
I wonder if this actually is true. While it is not supported now, we could/might use this to import/merge attributes even without definition. 
But of course, I have no hard feelings about having this assert now and remove it later on once other use cases are actually supported.


Repository:
  rC Clang

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

https://reviews.llvm.org/D55132





More information about the cfe-commits mailing list