[llvm] r268966 - Separate the Verifier into an analysis and a transformation pass and

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 13:56:22 PDT 2016


> On May 9, 2016, at 12:57 PM, Adrian Prantl via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 

Here’s a call for help to the MSVC experts:

It looks like this commit caused an an assertion in MSVC 12. Does anyone have any idea how to work around this? I don’t have access to Windows machine and I also don’t see any particularly sketchy code constructs.

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/12048

FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe   /nologo /TP /DWIN32 /D_WINDOWS   /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Oi /Zc:rvalueCast /MD /O2 /Ob2 -Iunittests\IR -ID:\buildslave\clang-x64-ninja-win7\llvm\unittests\IR -Iinclude -ID:\buildslave\clang-x64-ninja-win7\llvm\include -ID:\buildslave\clang-x64-ninja-win7\llvm\utils\unittest\googletest\include    -UNDEBUG  /EHs-c- /GR- /showIncludes -DGTEST_HAS_RTTI=0 -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS /Founittests\IR\CMakeFiles\IRTests.dir\VerifierTest.cpp.obj /Fdunittests\IR\CMakeFiles\IRTests.dir\ /FS -c D:\buildslave\clang-x64-ninja-win7\llvm\unittests\IR\VerifierTest.cpp
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\vector(2144) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'msc1.cpp', line 1325)
 To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++ 
 Help menu, or open the Technical Support help file for more information
Internal Compiler Error in C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe.  You will be prompted to send an error report to Microsoft later.
INTERNAL COMPILER ERROR in 'C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe'
    Please choose the Technical Support command on the Visual C++
    Help menu, or open the Technical Support help file for more information
ninja: build stopped: subcommand failed.



The relevant change is:

> Modified: llvm/trunk/unittests/IR/VerifierTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/VerifierTest.cpp?rev=268966&r1=268965&r2=268966&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/VerifierTest.cpp (original)
> +++ llvm/trunk/unittests/IR/VerifierTest.cpp Mon May  9 14:57:29 2016
> @@ -144,5 +144,30 @@ TEST(VerifierTest, CrossModuleMetadataRe
>   EXPECT_TRUE(StringRef(ErrorOS.str())
>                   .startswith("Referencing global in another module!"));
> }
> +
> +TEST(VerifierTest, StripInvalidDebugInfo) {
> +  LLVMContext C;
> +  Module M("M", C);
> +  DIBuilder DIB(M);
> +  DIB.createCompileUnit(dwarf::DW_LANG_C89, "broken.c", "/",
> +                        "unittest", false, "", 0);
> +  DIB.finalize();
> +  EXPECT_FALSE(verifyModule(M));
> +
> +  // Now break it.
> +  auto *File = DIB.createFile("not-a-CU.f", ".");
> +  NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu");
> +  NMD->addOperand(File);
> +  EXPECT_TRUE(verifyModule(M));
> +
> +  ModulePassManager MPM(true);
> +  MPM.addPass(VerifierPass(false));
> +  ModuleAnalysisManager MAM(true);
> +  MAM.registerPass([&] { return VerifierAnalysis(); });
> +  MPM.run(M, MAM);
> +  EXPECT_FALSE(verifyModule(M));
> +}
> +
> +
> } // end anonymous namespace
> } // end namespace llvm
> 

Thanks for your help!
-- adrian


More information about the llvm-commits mailing list