Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP getting master-next up and running with clang::ModuleMacro #10519

Merged
merged 3 commits into from
Jun 30, 2017

Conversation

jrose-apple
Copy link
Contributor

For pre-review purposes, mostly. The interesting commit is the one about ModuleMacro, though really we should be able to apply that to regular-master when it's ready.

@jrose-apple
Copy link
Contributor Author

cc @compnerd, @bob-wilson

@jrose-apple
Copy link
Contributor Author

I haven't been able to test this because of various other problems on the master-next branch.

I'm not a SIL author, so it's likely that this could be improved,
but I think this is closest to the old LLVM behavior.
@jrose-apple
Copy link
Contributor Author

cc @gottesmm

@gottesmm
Copy link
Member

@jrose-apple Thanks Jordan!

@gottesmm
Copy link
Member

Also cc @lhames

@gottesmm
Copy link
Member

btw, @jrose-apple cross repo testing works with master-next if you want to try the two PRs together.

@jrose-apple
Copy link
Contributor Author

Still plenty of local failures for now. :-(

@jrose-apple
Copy link
Contributor Author

Okay, this isn't right yet, but it's back in a shape where we can make progress. Let's see where we are.

apple/swift-clang#93
@swift-ci Please test

@swift-ci
Copy link
Collaborator

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - b02d6a8db20bffc1a77222e62542042b2eea5723
Test requested by - @jrose-apple

@swift-ci
Copy link
Collaborator

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - b02d6a8db20bffc1a77222e62542042b2eea5723
Test requested by - @jrose-apple

@gottesmm
Copy link
Member

@jrose-apple Just took a quick look at the failure on OS X (for some reason, the ci display is saying that builds are still running, but I think the display is wrong).

The error is:


Assertion failed: (isa<X>(Val) && "cast_or_null<Ty>() argument of incompatible type!"), function cast_or_null, file /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master-next/llvm/include/llvm/Support/Casting.h, line 299.
17:13:57 0  swift                    0x0000000107cd45d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
17:13:57 1  swift                    0x0000000107cd4c96 SignalHandler(int) + 470
17:13:57 2  libsystem_platform.dylib 0x00007fffafa0bb3a _sigtramp + 26
17:13:57 3  swift                    0x00000001080bbe41 encodeBase64StringEntry(char*, unsigned long long)::Alphabet + 106289
17:13:57 4  libsystem_c.dylib        0x00007fffaf890420 abort + 129
17:13:57 5  libsystem_c.dylib        0x00007fffaf857893 basename_r + 0
17:13:57 6  swift                    0x0000000106112e7b llvm::DIScope::getFilename() const + 187
17:13:57 7  swift                    0x000000010610ca3f llvm::DwarfCompileUnit::constructImportedEntityDIE(llvm::DIImportedEntity const*) + 383
17:13:57 8  swift                    0x00000001061131b2 llvm::DwarfDebug::constructAndAddImportedEntityDIE(llvm::DwarfCompileUnit&, llvm::DIImportedEntity const*) + 114
17:13:57 9  swift                    0x0000000106113f3a llvm::DwarfDebug::beginModule() + 3162
17:13:57 10 swift                    0x00000001060e7f70 llvm::AsmPrinter::doInitialization(llvm::Module&) + 1392
17:13:57 11 swift                    0x0000000107bafe0b llvm::FPPassManager::doInitialization(llvm::Module&) + 75
17:13:57 12 swift                    0x0000000107bb01af llvm::legacy::PassManagerImpl::run(llvm::Module&) + 687
17:13:57 13 swift                    0x00000001049fb130 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >) + 12976
17:13:57 14 swift                    0x0000000104c56d04 (anonymous namespace)::PCHContainerGenerator::HandleTranslationUnit(clang::ASTContext&) + 1316
17:13:57 15 swift                    0x0000000106f89dac clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) + 44
17:13:57 16 swift                    0x0000000107090dd2 clang::ParseAST(clang::Sema&, bool, bool) + 466
17:13:57 17 swift                    0x0000000106f6322c clang::FrontendAction::Execute() + 76
17:13:57 18 swift                    0x0000000106f266e1 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1217
17:13:57 19 swift                    0x0000000106f2f8a4 void llvm::function_ref<void ()>::callback_fn<compileModuleImpl(clang::CompilerInstance&, clang::SourceLocation, llvm::StringRef, clang::FrontendInputFile, llvm::StringRef, llvm::StringRef, llvm::function_ref<void (clang::CompilerInstance&)>, llvm::function_ref<void (clang::CompilerInstance&)>)::$_3>(long) + 52
17:13:57 20 swift                    0x0000000107c706ee llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 222
17:13:57 21 swift                    0x0000000107c70870 RunSafelyOnThread_Dispatch(void*) + 48
17:13:57 22 swift                    0x0000000107cd5eed ExecuteOnThread_Dispatch(void*) + 13
17:13:57 23 libsystem_pthread.dylib  0x00007fffafa1593b _pthread_body + 180
17:13:57 24 libsystem_pthread.dylib  0x00007fffafa15887 _pthread_body + 0
17:13:57 25 libsystem_pthread.dylib  0x00007fffafa1508d thread_start + 13
17:13:57 Stack dump:
17:13:57 0.	<eof> parser at end of file
17:13:57 1.	Code generation
17:13:57 
17:13:57 

That suggests we need to call in @adrian-prantl.

@@ -355,3 +355,7 @@ bool SILBasicBlock::isTrampoline() const {
return false;
return begin() == Branch->getIterator();
}

bool SILBasicBlock::isLegalToHoistInto() const {
return true;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gottesmm, is this the right implementation for now? If so I'll extract it out into a separate PR so we can land it and be done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I talked with Arnold and I don't think we use this. If you do extract this, can you change the return to false so we are conservative?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jordan pointed out via IM that this is used in other parts of loop info that we may use and that the old behavior was to always hoist. So given that, I am fine just taking this if it gets the build going. We can fix the test failures later. But at least we know things build.

@gottesmm
Copy link
Member

Jordan says that he is unavailable to merge this. I am going to merge this for him so we can get the build going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants