~ubuntu-branches/ubuntu/trusty/llvm-toolchain-snapshot/trusty-201310232150

« back to all changes in this revision

Viewing changes to clang/lib/Frontend/CompilerInstance.cpp

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-27 15:01:57 UTC
  • mfrom: (0.10.1) (0.9.1) (0.8.1) (0.7.1) (0.6.1) (0.5.2)
  • Revision ID: package-import@ubuntu.com-20130527150157-tdkrsjpuvht7v0qx
Tags: 1:3.4~svn182733-1~exp1
* New snapshot release (3.4 release)
* Add a symlink of libLLVM-3.4.so.1 to usr/lib/llvm-3.4/lib/libLLVM-3.4.so
    to fix make the llvm-config-3.4 --libdir work (Closes: #708677)
  * Various packages rename to allow co installations:
    * libclang1 => libclang1-3.4
    * libclang1-dbg => libclang1-3.4-dbg
    * libclang-dev => libclang-3.4-dev
    * libclang-common-dev => libclang-common-3.4-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
}
156
156
 
157
157
void CompilerInstance::createDiagnostics(DiagnosticConsumer *Client,
158
 
                                         bool ShouldOwnClient,
159
 
                                         bool ShouldCloneClient) {
 
158
                                         bool ShouldOwnClient) {
160
159
  Diagnostics = createDiagnostics(&getDiagnosticOpts(), Client,
161
 
                                  ShouldOwnClient, ShouldCloneClient,
162
 
                                  &getCodeGenOpts());
 
160
                                  ShouldOwnClient, &getCodeGenOpts());
163
161
}
164
162
 
165
163
IntrusiveRefCntPtr<DiagnosticsEngine>
166
164
CompilerInstance::createDiagnostics(DiagnosticOptions *Opts,
167
165
                                    DiagnosticConsumer *Client,
168
166
                                    bool ShouldOwnClient,
169
 
                                    bool ShouldCloneClient,
170
167
                                    const CodeGenOptions *CodeGenOpts) {
171
168
  IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
172
169
  IntrusiveRefCntPtr<DiagnosticsEngine>
175
172
  // Create the diagnostic client for reporting errors or for
176
173
  // implementing -verify.
177
174
  if (Client) {
178
 
    if (ShouldCloneClient)
179
 
      Diags->setClient(Client->clone(*Diags), ShouldOwnClient);
180
 
    else
181
 
      Diags->setClient(Client, ShouldOwnClient);
 
175
    Diags->setClient(Client, ShouldOwnClient);
182
176
  } else
183
177
    Diags->setClient(new TextDiagnosticPrinter(llvm::errs(), Opts));
184
178
 
868
862
  // module.
869
863
  CompilerInstance Instance;
870
864
  Instance.setInvocation(&*Invocation);
871
 
  Instance.createDiagnostics(&ImportingInstance.getDiagnosticClient(),
872
 
                             /*ShouldOwnClient=*/true,
873
 
                             /*ShouldCloneClient=*/true);
 
865
 
 
866
  Instance.createDiagnostics(new ForwardingDiagnosticConsumer(
 
867
                                   ImportingInstance.getDiagnosticClient()),
 
868
                             /*ShouldOwnClient=*/true);
874
869
 
875
870
  // Note that this module is part of the module build stack, so that we
876
871
  // can detect cycles in the module graph.
892
887
  llvm::CrashRecoveryContext CRC;
893
888
  CompileModuleMapData Data = { Instance, CreateModuleAction };
894
889
  CRC.RunSafelyOnThread(&doCompileMapModule, &Data, ThreadStackSize);
 
890
 
895
891
  
896
892
  // Delete the temporary module map file.
897
893
  // FIXME: Even though we're executing under crash protection, it would still
1251
1247
    case ASTReader::VersionMismatch:
1252
1248
    case ASTReader::ConfigurationMismatch:
1253
1249
    case ASTReader::HadErrors:
 
1250
      ModuleLoader::HadFatalFailure = true;
1254
1251
      // FIXME: The ASTReader will already have complained, but can we showhorn
1255
1252
      // that diagnostic information into a more useful form?
1256
1253
      KnownModules[Path[0].first] = 0;
1257
1254
      return ModuleLoadResult();
1258
1255
 
1259
1256
    case ASTReader::Failure:
 
1257
      ModuleLoader::HadFatalFailure = true;
1260
1258
      // Already complained, but note now that we failed.
1261
1259
      KnownModules[Path[0].first] = 0;
1262
1260
      ModuleBuildFailed = true;