Do you have access to a Windows machien to test on? I suspect it's going to require Windows to reproduce.<br><br><div class="gmail_quote">On Tue Dec 09 2014 at 2:54:44 PM Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Weird, it passed an LTO bootstrap for me.<br>
<br>
Is it possible to file a PR with a testcase? I'll look at it right<br>
away.<br>
<br>
> On 2014 Dec 9, at 14:50, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
><br>
> Just an additional heads up that there may be some runtime issues with the patch as well.<br>
><br>
> Running this command:<br>
> d:\src\llvm\build\ninja\bin\<u></u>clang++.exe -std=c++11 -g -O0 -m32 -Id:/src/llvm/tools/lldb/test/<u></u>make/../../include -fno-exceptions -include d:/src/llvm/tools/lldb/test/<u></u>make/uncaught_exception.h -D_HAS_EXCEPTIONS=0 -O0 -c -o main.o main.cpp<br>
><br>
> Results in this:<br>
><br>
> Stack dump:<br>
> 0. Program arguments: d:\src\llvm\build\ninja\bin\<u></u>clang++.exe -cc1 -triple i686-pc-windows-msvc -emit-obj -mrelax-all -disable-free -main-file-name main.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -g<br>
> -dwarf-column-info -coverage-file d:\src\llvm\tools\lldb\test\<u></u>functionalities\data-<u></u>formatter\data-formatter-stl\<u></u>libcxx\vbool\main.o -resource-dir d:\src\llvm\build\ninja\bin\..<u></u>\lib\clang\3.6.0 -include d:/src/llvm/tools/lldb/test/<u></u>make/uncaught_exception.h -D _HAS_EXCEPTIONS=0 -I d:/src/llvm/tools/ll<br>
> db/test/make/../../include -internal-isystem d:\src\llvm\build\ninja\bin\..<u></u>\lib\clang\3.6.0\include -internal-isystem C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include -internal-isystem C:\Program Files (x86)\Windows Kits\8.1\include\shared -internal-isystem C:\Program Files (x86)\Windo<br>
> ws Kits\8.1\include\um -internal-isystem C:\Program Files (x86)\Windows Kits\8.1\include\winrt -O0 -std=c++11 -fdeprecated-macro -fdebug-compilation-dir d:\src\llvm\tools\lldb\test\<u></u>functionalities\data-<u></u>formatter\data-formatter-stl\<u></u>libcxx\vbool -ferror-limit 19 -fmessage-length 300 -mstackrealign -fm<br>
> s-extensions -fms-compatibility -fms-compatibility-version=17.<u></u>00 -fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o main.o -x c++ main.cpp<br>
> 1. <eof> parser at end of file<br>
> 2. Per-file LLVM IR generation<br>
> 0x578AAA3B (0x07C903C4 0x07C903E4 0x07C903E4 0x05D8E590), ??3@YAXPAX@Z() + 0xAB bytes(s)<br>
> 0x01242744 (0x07C903E4 0x07C903E4 0x05D8E5AC 0x01242B8A), llvm::MDNode::operator delete() + 0x34 bytes(s), d:\src\llvm\lib\ir\metadata.<u></u>cpp, line 388 + 0x14 byte(s)<br>
> 0x0124D367 (0x00000001 0x00000000 0xCCCCCCCC 0x07C903E4), llvm::MDNodeFwdDecl::`scalar deleting destructor'() + 0x27 bytes(s)<br>
> 0x01242B8A (0x07C903E4 0x05D8E788 0x05D8E7FC 0xCCCCCCCC), llvm::MDNode::deleteTemporary(<u></u>) + 0x8A bytes(s), d:\src\llvm\lib\ir\metadata.<u></u>cpp, line 591 + 0x25 byte(s)<br>
> 0x01148933 (0x06150E78 0x07C903E4 0x05D8E7E4 0x05D8E7FC), llvm::DIDescriptor::<u></u>replaceAllUsesWith() + 0x123 bytes(s), d:\src\llvm\lib\ir\debuginfo.<u></u>cpp, line 342 + 0x9 byte(s)<br>
> 0x01C824B7 (0x05D8E848 0x05D8E7FC 0xCCCCCCCC 0xCCCCCCCC), clang::CodeGen::CGDebugInfo::<u></u>finalize() + 0x2A7 bytes(s), d:\src\llvm\tools\clang\lib\<u></u>codegen\cgdebuginfo.cpp, line 3390<br>
> 0x01C112BB (0x0618BE90 0x05D8E848 0x01BEFB40 0x0617DDE0), clang::CodeGen::CodeGenModule:<u></u>:Release() + 0x3CB bytes(s), d:\src\llvm\tools\clang\lib\<u></u>codegen\codegenmodule.cpp, line 415<br>
> 0x01C0E576 (0x0617DDE0 0x05D8E8D0 0x05D8E854 0xCCCCCCCC), `anonymous namespace'::CodeGeneratorImpl:<u></u>:HandleTranslationUnit() + 0x86 bytes(s), d:\src\llvm\tools\clang\lib\<u></u>codegen\modulebuilder.cpp, line 198<br>
> 0x01BEFB40 (0x0617DDE0 0x05D8EAD0 0x05D8E8E0 0x061B8890), clang::BackendConsumer::<u></u>HandleTranslationUnit() + 0x60 bytes(s), d:\src\llvm\tools\clang\lib\<u></u>codegen\codegenaction.cpp, line 131 + 0x21 byte(s)<br>
> 0x025B1717 (0x061A2460 0x00000000 0x00000000 0x05D8EAD8), clang::ParseAST() + 0x237 bytes(s), d:\src\llvm\tools\clang\lib\<u></u>parse\parseast.cpp, line 154 + 0x18 byte(s)<br>
> 0x018BF641 (0x05D8EB54 0x05D8EAD8 0xCCCCCCCC 0xCCCCCCCC), clang::ASTFrontendAction::<u></u>ExecuteAction() + 0x101 bytes(s), d:\src\llvm\tools\clang\lib\<u></u>frontend\frontendaction.cpp, line 527 + 0x30 byte(s)<br>
> 0x01BEC33F (0x05D8EB00 0xCCCCCCCC 0xCCCCCCCC 0xCCCCCCCC), clang::CodeGenAction::<u></u>ExecuteAction() + 0x3CF bytes(s), d:\src\llvm\tools\clang\lib\<u></u>codegen\codegenaction.cpp, line 729<br>
> 0x018BF22E (0x05D8EBF8 0x00000000 0xCCCCCCCC 0xCCCCCCCC), clang::FrontendAction::<u></u>Execute() + 0x7E bytes(s), d:\src\llvm\tools\clang\lib\<u></u>frontend\frontendaction.cpp, line 428 + 0xF byte(s)<br>
> 0x0187A821 (0x06158390 0x05D8F100 0x00000000 0xCCCCCCCC), clang::CompilerInstance::<u></u>ExecuteAction() + 0x2A1 bytes(s), d:\src\llvm\tools\clang\lib\<u></u>frontend\compilerinstance.cpp, line 812<br>
> 0x019CDDBE (0x06152A98 0x05D8FEC8 0xCCCCCCCC 0xCCCCCCCC), clang::<u></u>ExecuteCompilerInvocation() + 0x30E bytes(s), d:\src\llvm\tools\clang\lib\<u></u>frontendtool\<u></u>executecompilerinvocation.cpp, line 222 + 0x11 byte(s)<br>
> 0x0041461F (0x05D8FAB0 0x0000003D 0x06155AD0 0x0035139D), cc1_main() + 0x2FF bytes(s), d:\src\llvm\tools\clang\tools\<u></u>driver\cc1_main.cpp, line 110 + 0xE byte(s)<br>
> 0x003FFC18 (0x05D8FAA8 0x0000003F 0x06155AFC 0x00000000), ExecuteCC1Tool() + 0x78 bytes(s), d:\src\llvm\tools\clang\tools\<u></u>driver\driver.cpp, line 369 + 0x2B byte(s)<br>
> 0x003FFFB5 (0x0000003F 0x061519E8 0x06145120 0x5DB515C0), main() + 0x2F5 bytes(s), d:\src\llvm\tools\clang\tools\<u></u>driver\driver.cpp, line 415 + 0x33 byte(s)<br>
> 0x034BDA89 (0x05D8FF2C 0x75CC919F 0x7EDD4000 0x05D8FF70), __tmainCRTStartup() + 0x199 bytes(s), f:\dd\vctools\crt\crtw32\<u></u>dllstuff\crtexe.c, line 626 + 0x19 byte(s)<br>
> 0x034BDBCD (0x7EDD4000 0x05D8FF70 0x77A40BBB 0x7EDD4000), mainCRTStartup() + 0xD bytes(s), f:\dd\vctools\crt\crtw32\<u></u>dllstuff\crtexe.c, line 466<br>
> 0x75CC919F (0x7EDD4000 0x2F016EAA 0x00000000 0x00000000), BaseThreadInitThunk() + 0xE bytes(s)<br>
> 0x77A40BBB (0xFFFFFFFF 0x77A2C9D1 0x00000000 0x00000000), RtlInitializeExceptionChain() + 0x84 bytes(s)<br>
> 0x77A40B91 (0x034BDBC0 0x7EDD4000 0x00000000 0x00000000), RtlInitializeExceptionChain() + 0x5A bytes(s)<br>
> ^C<br>
> d:\src\llvm\tools\lldb\test\<u></u>functionalities\data-<u></u>formatter\data-formatter-stl\<u></u>libcxx\vbool><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Tue Dec 09 2014 at 2:41:09 PM Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>> wrote:<br>
> Awesome, thanks for the help!<br>
><br>
> > On 2014 Dec 9, at 14:28, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
> ><br>
> > This fixes the issue. I will check in your patch. Thanks!<br>
> ><br>
> > On Tue Dec 09 2014 at 2:20:02 PM Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
> > Testing now. I notice a few of the changes aren't actually required in order to fix compiler errors. For example, this line:<br>
> ><br>
> > - ConstantInt *constant_int = dyn_cast<ConstantInt>(alloc_<u></u>md->getOperand(0));<br>
> > + ConstantInt *constant_int = mdconst::dyn_extract<<u></u>ConstantInt>(alloc_md-><u></u>getOperand(0));<br>
> ><br>
> > wasn't actually failing. Not sure if that's important, but I'm using your fixed version anyway.<br>
> ><br>
> > On Tue Dec 09 2014 at 2:11:08 PM Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>> wrote:<br>
> > Attaching a patch that should fix it. Can you try compiling?<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > > On 2014 Dec 9, at 14:03, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
> > ><br>
> > > Here's the 3 errors.<br>
> > ><br>
> > > ..\..\tools\lldb\source\<u></u>Expression\IRForTarget.cpp(<u></u>413) : error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'const llvm::MDOperand' (or there is no acceptable conversion)<br>
> > > d:\src\llvm\include\llvm/ADT/<u></u>APSInt.h(291): could be 'bool llvm::operator !=(int64_t,const llvm::APSInt &)'<br>
> > > d:\src\llvm\include\llvm/ADT/<u></u>APInt.h(1724): or 'bool llvm::operator !=(uint64_t,const llvm::APInt &)'<br>
> > > d:\src\llvm\include\llvm/ADT/<u></u>StringRef.h(527): or 'bool llvm::operator !=(llvm::StringRef,llvm::<u></u>StringRef)'<br>
> > > while trying to match the argument list '(const llvm::MDOperand, const llvm::GlobalValue *)'<br>
> > ><br>
> > ><br>
> > ><br>
> > > ..\..\tools\lldb\source\<u></u>Expression\IRForTarget.cpp(<u></u>647) : error C2664: 'llvm::MDNode *llvm::MDNode::get(llvm::<u></u>LLVMContext &,llvm::ArrayRef<llvm::<u></u>Metadata *>)' : cannot convert argument 2 from 'llvm::ArrayRef<llvm::Value *>' to 'llvm::ArrayRef<llvm::Metadata *>'<br>
> > > No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called<br>
> > ><br>
> > ><br>
> > > ..\..\tools\lldb\source\<u></u>Expression\IRForTarget.cpp(<u></u>1254) : error C2664: 'llvm::MDNode *llvm::MDNode::get(llvm::<u></u>LLVMContext &,llvm::ArrayRef<llvm::<u></u>Metadata *>)' : cannot convert argument 2 from 'llvm::ArrayRef<llvm::Value *>' to 'llvm::ArrayRef<llvm::Metadata *>'<br>
> > > No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called<br>
> > ><br>
> > ><br>
> > > On Tue Dec 09 2014 at 1:56:03 PM Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
> > > I'm not sure what the status of building LLDB with CMake is, but the normal way apple people build LLDB is to structure the directory like this:<br>
> > ><br>
> > > lldb<br>
> > > --llvm<br>
> > > ----tools<br>
> > > ------clang<br>
> > ><br>
> > > Then open the xcode workspace and build the lldb-tool target.<br>
> > ><br>
> > > I'll sync to ToT again though so that I can get you a dump of the compiler errors I'm seeing.<br>
> > ><br>
> > > On Tue Dec 09 2014 at 1:52:40 PM Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>> wrote:<br>
> > > I'm trying to build lldb now, but it's hung trying to build LLVM and<br>
> > > clang... but I already built these? I don't really understand.<br>
> > ><br>
> > > Is there any way to make lldb point to my LLVM checkout? I just want to<br>
> > > see the compiler errors so I can fix them :(.<br>
> > ><br>
> > > Alternatively, if some can email me a compile log with all the errors<br>
> > > (can you do a `make -k` or something?) I can send you a patch... this is<br>
> > > mechanical to update, but I need the compiler to tell me what's wrong.<br>
> > ><br>
> > > I expect the fixes to all be along these lines:<br>
> > ><br>
> > > - Value *Ops[] => Metadata *Ops[]<br>
> > ><br>
> > > - cast<ConstantInt>(N-><u></u>getOperand(0)) =><br>
> > > mdconst::extract<ConstantInt>(<u></u>N->getOperand(0))<br>
> > ><br>
> > > - Value *Op = ConstantInt::get(...) =><br>
> > > Metadata *Op = ConstantAsMetadata::get(<u></u>ConstantInt::get(...))<br>
> > ><br>
> > > Sorry for the breakage :(.<br>
> > ><br>
> > > > On 2014 Dec 9, at 13:41, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
> > > ><br>
> > > > If you sync llvm past git revision db7b69e3a634c5fdff0eceeee2a41e<u></u>e49c3270a2 (svn r223802), your LLDB build will be broken.<br>
> > > ><br>
> > > > I was able to fix one of the errors, but this isn't really my area of expertise, so I stopped when I realized I didn't know what I was doing.<br>
> > > ><br>
> > > > Just a warning not to sync LLVM until this is fixed. I've CC'ed Sean and Duncan as they are probably the best people to fix this, but if anyone else knows how to fix it, feel free.<br>
> > ><br>
> ><br>
><br>
<br>
</blockquote></div>