================
@@ -38,14 +42,24 @@ std::string teardownProfiler() {
 
 // Returns true if code compiles successfully.
 // We only parse AST here. This is enough for constexpr evaluation.
-bool compileFromString(StringRef Code, StringRef Standard, StringRef FileName) 
{
+bool compileFromString(StringRef Code, StringRef Standard, StringRef File,
+                       llvm::StringMap<StringRef> Headers = {}) {
----------------
ilya-biryukov wrote:

NIT: `StringMap<StringRef>` is a bit of a trap because it's way too easy to 
write something like `map.insert("foo.h", std::string("#include <vector>\n") + 
std::string("#include <map>"))` and get into a state where the string is 
incorrect.
And we don't really need to avoid copies in tests for efficiency purposes, so 
I'd recommend just using `StringMap<string>` instead to minimize the chance of 
getting potential use-after-free surprises in the future.

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

Reply via email to