LLVM Modules without Target Triple

Hey there!

I am working on a project where we get LLVM IR generated from swift code that ends up being a xcode-framework.

During all of that I am doing some modifications on the IR level that depend on the target architecture of the module.

My initial try was to look at the target triple (via Module::getTargetTriple) and then figure out the target-architecture, the environment, etc.
However, when I ran the modifications on the IR generated from swift, there were modules that:

  • do not have a target triple (just an empty string)
  • thus also no Darwin Variant Triple
  • do not have a module ID (usually that's the path to the source file)

Are these modules generated by the swift frontend for some reason and needed for internal linking? Or in general, what is the use of such modules?