}
void CommandMangler::adjust(std::vector<std::string> &Cmd) const {
- // FIXME: remove const_cast once unique_function is const-compatible.
- for (auto &Edit : const_cast<Config &>(Config::current()).CompileFlags.Edits)
+ for (auto &Edit : Config::current().CompileFlags.Edits)
Edit(Cmd);
// Check whether the flag exists, either as -flag or -flag=*
/// Controls how the compile command for the current file is determined.
struct {
// Edits to apply to the compile command, in sequence.
- // FIXME: these functions need to be const-callable. For now, const_cast.
- std::vector<llvm::unique_function<void(std::vector<std::string> &)>> Edits;
+ std::vector<llvm::unique_function<void(std::vector<std::string> &) const>>
+ Edits;
} CompileFlags;
};