Move the verbose asm option to be part of the options struct and
[oota-llvm.git] / tools / llc / llc.cpp
index 269a5df9041411ace5f8b2bd6994836743de972b..abdc1ab634cf76bfe4023438a3374fbb9a1898dc 100644 (file)
@@ -273,6 +273,10 @@ static int compileModule(char **argv, LLVMContext &Context) {
   TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
   Options.DisableIntegratedAS = NoIntegratedAssembler;
 
+  // Override default to generate verbose assembly unless we've seen the flag.
+  if (AsmVerbose.getNumOccurrences() == 0)
+    Options.MCOptions.AsmVerbose = true;
+
   std::unique_ptr<TargetMachine> target(
       TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, FeaturesStr,
                                      Options, RelocModel, CMModel, OLvl));
@@ -309,9 +313,6 @@ static int compileModule(char **argv, LLVMContext &Context) {
     mod->setDataLayout(DL);
   PM.add(new DataLayoutPass(mod));
 
-  // Override default to generate verbose assembly.
-  Target.setAsmVerbosityDefault(true);
-
   if (RelaxAll.getNumOccurrences() > 0 &&
       FileType != TargetMachine::CGFT_ObjectFile)
     errs() << argv[0]