Switching Clang UniqueInternalLinkageNamesPass scheduling to using the LLVM one with...
authorHongtao Yu <hoy@fb.com>
Mon, 4 Jan 2021 18:15:59 +0000 (10:15 -0800)
committerHongtao Yu <hoy@fb.com>
Mon, 4 Jan 2021 20:04:46 +0000 (12:04 -0800)
As a follow-up to D93656, I'm switching the Clang UniqueInternalLinkageNamesPass scheduling to using the LLVM one with newpm.

Test Plan:

Reviewed By: aeubanks, tmsriram

Differential Revision: https://reviews.llvm.org/D94019

clang/lib/CodeGen/BackendUtil.cpp

index b326c643738f80d2a1044eeabf43ae9db6aedc74..296b111feb2da46dde24d710ed5c127fa806e332 100644 (file)
@@ -1145,6 +1145,7 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
   // non-integrated assemblers don't recognize .cgprofile section.
   PTO.CallGraphProfile = !CodeGenOpts.DisableIntegratedAS;
   PTO.Coroutines = LangOpts.Coroutines;
+  PTO.UniqueLinkageNames = CodeGenOpts.UniqueInternalLinkageNames;
 
   PassInstrumentationCallbacks PIC;
   StandardInstrumentations SI(CodeGenOpts.DebugPassManager);
@@ -1326,11 +1327,6 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
       MPM = PB.buildPerModuleDefaultPipeline(Level);
     }
 
-    // Add UniqueInternalLinkageNames Pass which renames internal linkage
-    // symbols with unique names.
-    if (CodeGenOpts.UniqueInternalLinkageNames)
-      MPM.addPass(UniqueInternalLinkageNamesPass());
-
     if (!CodeGenOpts.MemoryProfileOutput.empty()) {
       MPM.addPass(createModuleToFunctionPassAdaptor(MemProfilerPass()));
       MPM.addPass(ModuleMemProfilerPass());