[PATCH] D51295: Allow resetting of NumCreatedFIDsForFileID

Phabricator via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 20 05:56:09 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC347304: Allow force updating the NumCreatedFIDsForFileID. (authored by vvassilev, committed by ).

Repository:
  rC Clang

https://reviews.llvm.org/D51295

Files:
  include/clang/Basic/SourceManager.h


Index: include/clang/Basic/SourceManager.h
===================================================================
--- include/clang/Basic/SourceManager.h
+++ include/clang/Basic/SourceManager.h
@@ -1024,13 +1024,14 @@
 
   /// Set the number of FileIDs (files and macros) that were created
   /// during preprocessing of \p FID, including it.
-  void setNumCreatedFIDsForFileID(FileID FID, unsigned NumFIDs) const {
+  void setNumCreatedFIDsForFileID(FileID FID, unsigned NumFIDs,
+                                  bool Force = false) const {
     bool Invalid = false;
     const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &Invalid);
     if (Invalid || !Entry.isFile())
       return;
 
-    assert(Entry.getFile().NumCreatedFIDs == 0 && "Already set!");
+    assert((Force || Entry.getFile().NumCreatedFIDs == 0) && "Already set!");
     const_cast<SrcMgr::FileInfo &>(Entry.getFile()).NumCreatedFIDs = NumFIDs;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51295.174757.patch
Type: text/x-patch
Size: 922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181120/93bb5301/attachment.bin>


More information about the cfe-commits mailing list