@@ -113,7 +113,7 @@ class EmitAssemblyHelper {
113
113
const CodeGenOptions &CodeGenOpts;
114
114
const clang::TargetOptions &TargetOpts;
115
115
const LangOptions &LangOpts;
116
- Module *TheModule;
116
+ llvm:: Module *TheModule;
117
117
IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS;
118
118
119
119
Timer CodeGenerationTime;
@@ -179,7 +179,7 @@ class EmitAssemblyHelper {
179
179
const HeaderSearchOptions &HeaderSearchOpts,
180
180
const CodeGenOptions &CGOpts,
181
181
const clang::TargetOptions &TOpts,
182
- const LangOptions &LOpts, Module *M,
182
+ const LangOptions &LOpts, llvm:: Module *M,
183
183
IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS)
184
184
: Diags(_Diags), HSOpts(HeaderSearchOpts), CodeGenOpts(CGOpts),
185
185
TargetOpts (TOpts), LangOpts(LOpts), TheModule(M), VFS(std::move(VFS)),
@@ -693,7 +693,7 @@ static void addSanitizers(const Triple &TargetTriple,
693
693
// the logic of the original code, but operates on "shadow" values. It
694
694
// can benefit from re-running some general purpose optimization
695
695
// passes.
696
- MPM.addPass (RequireAnalysisPass<GlobalsAA, Module>());
696
+ MPM.addPass (RequireAnalysisPass<GlobalsAA, llvm:: Module>());
697
697
FunctionPassManager FPM;
698
698
FPM.addPass (EarlyCSEPass (true /* Enable mem-ssa. */ ));
699
699
FPM.addPass (InstCombinePass ());
@@ -752,7 +752,7 @@ static void addSanitizers(const Triple &TargetTriple,
752
752
SanitizersCallback (NewMPM, Level);
753
753
if (!NewMPM.isEmpty ()) {
754
754
// Sanitizers can abandon<GlobalsAA>.
755
- NewMPM.addPass (RequireAnalysisPass<GlobalsAA, Module>());
755
+ NewMPM.addPass (RequireAnalysisPass<GlobalsAA, llvm:: Module>());
756
756
MPM.addPass (std::move (NewMPM));
757
757
}
758
758
});
@@ -1051,7 +1051,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
1051
1051
if (Action == Backend_EmitBC || Action == Backend_EmitLL) {
1052
1052
if (CodeGenOpts.PrepareForThinLTO && !CodeGenOpts.DisableLLVMPasses ) {
1053
1053
if (!TheModule->getModuleFlag (" EnableSplitLTOUnit" ))
1054
- TheModule->addModuleFlag (Module::Error, " EnableSplitLTOUnit" ,
1054
+ TheModule->addModuleFlag (llvm:: Module::Error, " EnableSplitLTOUnit" ,
1055
1055
CodeGenOpts.EnableSplitLTOUnit );
1056
1056
if (Action == Backend_EmitBC) {
1057
1057
if (!CodeGenOpts.ThinLinkBitcodeFile .empty ()) {
@@ -1060,7 +1060,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
1060
1060
return ;
1061
1061
}
1062
1062
if (CodeGenOpts.UnifiedLTO )
1063
- TheModule->addModuleFlag (Module::Error, " UnifiedLTO" , uint32_t (1 ));
1063
+ TheModule->addModuleFlag (llvm:: Module::Error, " UnifiedLTO" , uint32_t (1 ));
1064
1064
MPM.addPass (ThinLTOBitcodeWriterPass (
1065
1065
*OS, ThinLinkOS ? &ThinLinkOS->os () : nullptr ));
1066
1066
} else {
@@ -1074,12 +1074,12 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
1074
1074
bool EmitLTOSummary = shouldEmitRegularLTOSummary ();
1075
1075
if (EmitLTOSummary) {
1076
1076
if (!TheModule->getModuleFlag (" ThinLTO" ) && !CodeGenOpts.UnifiedLTO )
1077
- TheModule->addModuleFlag (Module::Error, " ThinLTO" , uint32_t (0 ));
1077
+ TheModule->addModuleFlag (llvm:: Module::Error, " ThinLTO" , uint32_t (0 ));
1078
1078
if (!TheModule->getModuleFlag (" EnableSplitLTOUnit" ))
1079
- TheModule->addModuleFlag (Module::Error, " EnableSplitLTOUnit" ,
1079
+ TheModule->addModuleFlag (llvm:: Module::Error, " EnableSplitLTOUnit" ,
1080
1080
uint32_t (1 ));
1081
1081
if (CodeGenOpts.UnifiedLTO )
1082
- TheModule->addModuleFlag (Module::Error, " UnifiedLTO" , uint32_t (1 ));
1082
+ TheModule->addModuleFlag (llvm:: Module::Error, " UnifiedLTO" , uint32_t (1 ));
1083
1083
}
1084
1084
if (Action == Backend_EmitBC)
1085
1085
MPM.addPass (BitcodeWriterPass (*OS, CodeGenOpts.EmitLLVMUseLists ,
@@ -1093,13 +1093,13 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
1093
1093
// Set module flags, like EnableSplitLTOUnit and UnifiedLTO, since FatLTO
1094
1094
// uses a different action than Backend_EmitBC or Backend_EmitLL.
1095
1095
if (!TheModule->getModuleFlag (" ThinLTO" ))
1096
- TheModule->addModuleFlag (Module::Error, " ThinLTO" ,
1096
+ TheModule->addModuleFlag (llvm:: Module::Error, " ThinLTO" ,
1097
1097
uint32_t (CodeGenOpts.PrepareForThinLTO ));
1098
1098
if (!TheModule->getModuleFlag (" EnableSplitLTOUnit" ))
1099
- TheModule->addModuleFlag (Module::Error, " EnableSplitLTOUnit" ,
1099
+ TheModule->addModuleFlag (llvm:: Module::Error, " EnableSplitLTOUnit" ,
1100
1100
uint32_t (CodeGenOpts.EnableSplitLTOUnit ));
1101
1101
if (CodeGenOpts.UnifiedLTO && !TheModule->getModuleFlag (" UnifiedLTO" ))
1102
- TheModule->addModuleFlag (Module::Error, " UnifiedLTO" , uint32_t (1 ));
1102
+ TheModule->addModuleFlag (llvm:: Module::Error, " UnifiedLTO" , uint32_t (1 ));
1103
1103
}
1104
1104
1105
1105
// Print a textual, '-passes=' compatible, representation of pipeline if
@@ -1195,11 +1195,12 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
1195
1195
}
1196
1196
1197
1197
static void runThinLTOBackend (
1198
- DiagnosticsEngine &Diags, ModuleSummaryIndex *CombinedIndex, Module *M,
1199
- const HeaderSearchOptions &HeaderOpts, const CodeGenOptions &CGOpts,
1200
- const clang::TargetOptions &TOpts, const LangOptions &LOpts,
1201
- std::unique_ptr<raw_pwrite_stream> OS, std::string SampleProfile,
1202
- std::string ProfileRemapping, BackendAction Action) {
1198
+ DiagnosticsEngine &Diags, ModuleSummaryIndex *CombinedIndex,
1199
+ llvm::Module *M, const HeaderSearchOptions &HeaderOpts,
1200
+ const CodeGenOptions &CGOpts, const clang::TargetOptions &TOpts,
1201
+ const LangOptions &LOpts, std::unique_ptr<raw_pwrite_stream> OS,
1202
+ std::string SampleProfile, std::string ProfileRemapping,
1203
+ BackendAction Action) {
1203
1204
DenseMap<StringRef, DenseMap<GlobalValue::GUID, GlobalValueSummary *>>
1204
1205
ModuleToDefinedGVSummaries;
1205
1206
CombinedIndex->collectDefinedGVSummariesPerModule (ModuleToDefinedGVSummaries);
@@ -1268,18 +1269,18 @@ static void runThinLTOBackend(
1268
1269
Conf.SplitDwarfOutput = CGOpts.SplitDwarfOutput ;
1269
1270
switch (Action) {
1270
1271
case Backend_EmitNothing:
1271
- Conf.PreCodeGenModuleHook = [](size_t Task, const Module &Mod) {
1272
+ Conf.PreCodeGenModuleHook = [](size_t Task, const llvm:: Module &Mod) {
1272
1273
return false ;
1273
1274
};
1274
1275
break ;
1275
1276
case Backend_EmitLL:
1276
- Conf.PreCodeGenModuleHook = [&](size_t Task, const Module &Mod) {
1277
+ Conf.PreCodeGenModuleHook = [&](size_t Task, const llvm:: Module &Mod) {
1277
1278
M->print (*OS, nullptr , CGOpts.EmitLLVMUseLists );
1278
1279
return false ;
1279
1280
};
1280
1281
break ;
1281
1282
case Backend_EmitBC:
1282
- Conf.PreCodeGenModuleHook = [&](size_t Task, const Module &Mod) {
1283
+ Conf.PreCodeGenModuleHook = [&](size_t Task, const llvm:: Module &Mod) {
1283
1284
WriteBitcodeToFile (*M, *OS, CGOpts.EmitLLVMUseLists );
1284
1285
return false ;
1285
1286
};
@@ -1303,7 +1304,7 @@ void clang::EmitBackendOutput(DiagnosticsEngine &Diags,
1303
1304
const CodeGenOptions &CGOpts,
1304
1305
const clang::TargetOptions &TOpts,
1305
1306
const LangOptions &LOpts, StringRef TDesc,
1306
- Module *M, BackendAction Action,
1307
+ llvm:: Module *M, BackendAction Action,
1307
1308
IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
1308
1309
std::unique_ptr<raw_pwrite_stream> OS) {
1309
1310
0 commit comments