Bug in TargetRegistry.h?

Hi,

The code @ line 584 of TargetRegistry.h effectively suppresses specifying any
AsmStreamer constructor function but stock createAsmStreamer one. Is it by
intention or condition should be replaced with != ?

Best regards,

  Max

Hi,

The code @ line 584 of TargetRegistry.h effectively suppresses specifying any
AsmStreamer constructor function but stock createAsmStreamer one. Is it by
intention or condition should be replaced with != ?

Hi Max,

are you sure that you have the tip-of-tree version of
include/llvm/Support/TargetRegistry.h?

   static void RegisterMCInstrAnalysis(Target &T,
                                        Target::MCInstrAnalysisCtorFnTy Fn) {
      // Ignore duplicate registration.
      if (!T.MCInstrAnalysisCtorFn)
        T.MCInstrAnalysisCtorFn = Fn;
    } // line 584 is here

krasin

Hi Ivan,

Sorry for the confusion - in the latest version it is line 760:

    static void RegisterAsmStreamer(Target &T, Target::AsmStreamerCtorTy Fn) {
      if (T.AsmStreamerCtorFn == createAsmStreamer)
        T.AsmStreamerCtorFn = Fn;
    }

Best regards,

  Max

Sorry, my bad - completely misunderstood what's happening there. It just forces
one-time init of the T.AsmStreamerCtorFn.

Sorry again.

Best regards,

  Max