@@ -54,7 +54,7 @@ static bool compatibleMachineType(COFFLinkerContext &ctx, MachineTypes mt) {
5454}
5555
5656void SymbolTable::addFile (InputFile *file) {
57- log ( " Reading " + toString (file) );
57+ Log (ctx) << " Reading " << toString (file);
5858 if (file->lazy ) {
5959 if (auto *f = dyn_cast<BitcodeFile>(file))
6060 f->parseLazy ();
@@ -320,8 +320,8 @@ void SymbolTable::loadMinGWSymbols() {
320320 if (newName != origName && (l = find (newName)) != nullptr ) {
321321 // If we found a symbol and it is lazy; load it.
322322 if (l->isLazy () && !l->pendingArchiveLoad ) {
323- log ( " Loading lazy " + l->getName () + " from " +
324- l->getFile ()->getName () + " for stdcall fixup" ) ;
323+ Log (ctx) << " Loading lazy " << l->getName () << " from "
324+ << l->getFile ()->getName () << " for stdcall fixup" ;
325325 forceLazy (l);
326326 }
327327 // If it's lazy or already defined, hook it up as weak alias.
@@ -330,7 +330,8 @@ void SymbolTable::loadMinGWSymbols() {
330330 Warn (ctx) << " Resolving " << origName << " by linking to "
331331 << newName;
332332 else
333- log (" Resolving " + origName + " by linking to " + newName);
333+ Log (ctx) << " Resolving " << origName << " by linking to "
334+ << newName;
334335 undef->setWeakAlias (l);
335336 continue ;
336337 }
@@ -346,8 +347,8 @@ void SymbolTable::loadMinGWSymbols() {
346347 if (!l || l->pendingArchiveLoad || !l->isLazy ())
347348 continue ;
348349
349- log ( " Loading lazy " + l->getName () + " from " + l-> getFile ()-> getName () +
350- " for automatic import" ) ;
350+ Log (ctx) << " Loading lazy " << l->getName () << " from "
351+ << l-> getFile ()-> getName () << " for automatic import" ;
351352 forceLazy (l);
352353 }
353354 }
@@ -372,12 +373,12 @@ bool SymbolTable::handleMinGWAutomaticImport(Symbol *sym, StringRef name) {
372373 // reference itself to point at the IAT entry.
373374 size_t impSize = 0 ;
374375 if (isa<DefinedImportData>(imp)) {
375- log ( " Automatically importing " + name + " from " +
376- cast<DefinedImportData>(imp)->getDLLName () );
376+ Log (ctx) << " Automatically importing " << name << " from "
377+ << cast<DefinedImportData>(imp)->getDLLName ();
377378 impSize = sizeof (DefinedImportData);
378379 } else if (isa<DefinedRegular>(imp)) {
379- log ( " Automatically importing " + name + " from " +
380- toString (cast<DefinedRegular>(imp)->file ) );
380+ Log (ctx) << " Automatically importing " << name << " from "
381+ << toString (cast<DefinedRegular>(imp)->file );
381382 impSize = sizeof (DefinedRegular);
382383 } else {
383384 Warn (ctx) << " unable to automatically import " << name << " from "
@@ -398,7 +399,7 @@ bool SymbolTable::handleMinGWAutomaticImport(Symbol *sym, StringRef name) {
398399 if (refptr && refptr->getChunk ()->getSize () == ctx.config .wordsize ) {
399400 SectionChunk *sc = dyn_cast_or_null<SectionChunk>(refptr->getChunk ());
400401 if (sc && sc->getRelocs ().size () == 1 && *sc->symbols ().begin () == sym) {
401- log ( " Replacing .refptr." + name + " with " + imp->getName () );
402+ Log (ctx) << " Replacing .refptr." << name << " with " << imp->getName ();
402403 refptr->getChunk ()->live = false ;
403404 refptr->replaceKeepingName (imp, impSize);
404405 }
0 commit comments