forked from OSchip/llvm-project
[ELF] Make errorOrWarn opaque to decrease code size. NFC
In my x86-64 lld, .text is -3.08Ki smaller.
This commit is contained in:
parent
815786eb67
commit
d754c0b64f
|
@ -352,12 +352,7 @@ static inline ArrayRef<VersionDefinition> namedVersionDefs() {
|
|||
return llvm::makeArrayRef(config->versionDefinitions).slice(2);
|
||||
}
|
||||
|
||||
static inline void errorOrWarn(const Twine &msg) {
|
||||
if (!config->noinhibitExec)
|
||||
error(msg);
|
||||
else
|
||||
warn(msg);
|
||||
}
|
||||
void errorOrWarn(const Twine &msg);
|
||||
|
||||
static inline void internalLinkerError(StringRef loc, const Twine &msg) {
|
||||
errorOrWarn(loc + "internal linker error: " + msg + "\n" +
|
||||
|
|
|
@ -77,6 +77,13 @@ std::unique_ptr<LinkerDriver> elf::driver;
|
|||
static void setConfigs(opt::InputArgList &args);
|
||||
static void readConfigs(opt::InputArgList &args);
|
||||
|
||||
void elf::errorOrWarn(const Twine &msg) {
|
||||
if (config->noinhibitExec)
|
||||
warn(msg);
|
||||
else
|
||||
error(msg);
|
||||
}
|
||||
|
||||
bool elf::link(ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS,
|
||||
llvm::raw_ostream &stderrOS, bool exitEarly,
|
||||
bool disableOutput) {
|
||||
|
|
Loading…
Reference in New Issue