llvm/CodeGen/CommandFlags.h a utility function InitTargetOptionsFromCodeGenFlags which is used to set target options from flags based on the command line. The command line flags are stored in globals defined in the same file, and including the file in multiple places causes the globals to be defined multiple times, leading to linker errors. This change adds a single place in lld where these globals are defined and exports only the utility function. This makes it possible to call InitTargetOptionsFromCodeGenFlags from multiple places in lld, which a follow-up change will do.
Details
Details
- Reviewers
ruiu davide - Commits
- rG35989d6be572: add the ability to call InitTargetOptionsFromCodeGenFlags from multiple objects
rLLD293965: add the ability to call InitTargetOptionsFromCodeGenFlags from multiple objects
rL293965: add the ability to call InitTargetOptionsFromCodeGenFlags from multiple objects
Diff Detail
Diff Detail
- Build Status
Buildable 3498 Build 3498: arc lint + arc unit
Event Timeline
Comment Actions
Are you actually going to use InitTargetOptionsFromCodeGenFlag function defined in this patch in future?
Comment Actions
The code LGTM. If Rui/Peter think it's OK to ship this for COFF, I'm fine with this going in.
Comment Actions
Sorry for the belated response. I think this should live under lld/lib/Core instead of lld/lib/Config because this is not a configuration or something.
Comment Actions
LGTM
lib/Core/TargetOptionsCommandFlags.cpp | ||
---|---|---|
28 | I'd remove the outer namespace and s/InitTarget/lld::InitTarget/. |
I'd remove the outer namespace and s/InitTarget/lld::InitTarget/.