]> granicus.if.org Git - clang/commitdiff
CodeGenModule: Adapt to LLVM TargetLibraryInfo changes
authorMatthias Braun <matze@braunis.de>
Tue, 26 Sep 2017 02:37:23 +0000 (02:37 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 26 Sep 2017 02:37:23 +0000 (02:37 +0000)
Adapt to LLVM TargetLibraryInfo changes in r314185.

See also https://reviews.llvm.org/D38106 and https://reviews.llvm.org/D37891

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314187 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index a8cc50bdd646c853779ef485e2abdcf626793fe5..03a3e36b831abf6d9bd8382a0707e7ff765d09b4 100644 (file)
@@ -476,17 +476,11 @@ void CodeGenModule::Release() {
     getModule().addModuleFlag(llvm::Module::Warning, "Debug Info Version",
                               llvm::DEBUG_METADATA_VERSION);
 
-  // Width of wchar_t in bytes
-  uint64_t WCharWidth =
-      Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity();
-  assert((LangOpts.ShortWChar ||
-          llvm::TargetLibraryInfoImpl::getTargetWCharSize(Target.getTriple()) ==
-              Target.getWCharWidth() / 8) &&
-         "LLVM wchar_t size out of sync");
-
   // We need to record the widths of enums and wchar_t, so that we can generate
   // the correct build attributes in the ARM backend. wchar_size is also used by
   // TargetLibraryInfo.
+  uint64_t WCharWidth =
+      Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity();
   getModule().addModuleFlag(llvm::Module::Error, "wchar_size", WCharWidth);
 
   llvm::Triple::ArchType Arch = Context.getTargetInfo().getTriple().getArch();