================
@@ -3902,6 +3902,8 @@ void Preprocessor::HandleEmbedDirectiveImpl(
   }
 
   EmbedAnnotationData *Data = new (BP) EmbedAnnotationData;
+  Data->Filename = Filename;
+  Data->IsAngled = IsAngled;
   Data->BinaryData = BinaryContents;
----------------
AaronBallman wrote:

I think the way this may need to work is to find out where we're getting the 
file name from and seeing how long-lived that string is. It's passed here as a 
`StringRef`, and it would nice if we can store it as a `StringRef` in the 
`EmbedAnnotationData` rather than as a `std::string`. My guess is that the name 
comes from the `FileManager` and is as long-lived as the `SourceManager` which 
is owned by `ASTContext`, but we'd need to verify that.

https://github.com/llvm/llvm-project/pull/117770
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to