================
@@ -486,6 +492,22 @@ Error runSYCLLink(ArrayRef<std::string> Files, const
ArgList &Args) {
SmallVector<std::string> SplitModules;
SplitModules.emplace_back(*LinkedFile);
+ // Generate symbol table.
+ SmallVector<std::string> SymbolTable;
+ for (size_t I = 0, E = SplitModules.size(); I != E; ++I) {
+ Expected<std::unique_ptr<Module>> ModOrErr =
+ getBitcodeModule(SplitModules[I], C);
+ if (!ModOrErr)
+ return ModOrErr.takeError();
+
+ SmallVector<StringRef> Symbols;
+ for (Function &F : **ModOrErr) {
+ if (isKernel(F))
+ Symbols.push_back(F.getName());
+ }
+ SymbolTable.emplace_back(llvm::join(Symbols.begin(), Symbols.end(), "\n"));
----------------
jhuber6 wrote:
Right, that's a data structure that's basically `Map<string, const char *>` so
it doesn't know how to iterate over multiple of them. Now I'm wishing I put the
size of the string in as part of the `StringEntry`. (You could put that as a
string in a different string entry if you really wanted to). My main desire to
just stick with normal strings is that you don't need to bother with the `join`
stuff, but if it's that much of a pain I suppose it makes sense.
https://github.com/llvm/llvm-project/pull/161287
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits