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
[SR-7165] Excise iostream from reflection #15677
Conversation
…er error This solves errors below: ``` Undefined symbols for architecture x86_64: "llvm::raw_ostream::write(char const*, unsigned long)", referenced from: _swift_reflection_dumpTypeRef in SwiftRemoteMirror.cpp.o _swift_reflection_dumpInfoForTypeRef in SwiftRemoteMirror.cpp.o _swift_reflection_dumpInfoForMetadata in SwiftRemoteMirror.cpp.o _swift_reflection_dumpInfoForInstance in SwiftRemoteMirror.cpp.o PrintTypeRef::visitNominalTypeRef(swift::reflection::NominalTypeRef const*) in libswiftReflection.a(TypeRef.cpp.o) PrintTypeRef::visitBoundGenericTypeRef(swift::reflection::BoundGenericTypeRef const*) in libswiftReflection.a(TypeRef.cpp.o) PrintTypeRef::visitTupleTypeRef(swift::reflection::TupleTypeRef const*) in libswiftReflection.a(TypeRef.cpp.o) ... "llvm::raw_ostream::write(unsigned char)", referenced from: swift::reflection::TypeRef::dump() const in libswiftReflection.a(TypeRef.cpp.o) swift::reflection::TypeRef::dump(llvm::raw_ostream&, unsigned int) const in libswiftReflection.a(TypeRef.cpp.o) swift::reflection::TypeRefVisitor<PrintTypeRef, void>::visit(swift::reflection::TypeRef const*) in libswiftReflection.a(TypeRef.cpp.o) PrintTypeRef::visitBuiltinTypeRef(swift::reflection::BuiltinTypeRef const*) in libswiftReflection.a(TypeRef.cpp.o) PrintTypeRef::visitNominalTypeRef(swift::reflection::NominalTypeRef const*) in libswiftReflection.a(TypeRef.cpp.o) PrintTypeRef::visitBoundGenericTypeRef(swift::reflection::BoundGenericTypeRef const*) in libswiftReflection.a(TypeRef.cpp.o) PrintTypeRef::visitTupleTypeRef(swift::reflection::TupleTypeRef const*) in libswiftReflection.a(TypeRef.cpp.o) ... "llvm::raw_ostream::operator<<(unsigned long)", referenced from: llvm::raw_ostream& PrintTypeRef::printField<unsigned int>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned int const&) in libswiftReflection.a(TypeRef.cpp.o) swift::reflection::(anonymous namespace)::PrintTypeInfo::print(swift::reflection::TypeInfo const&) in libswiftReflection.a(TypeLowering.cpp.o) swift::reflection::(anonymous namespace)::PrintTypeInfo::printBasic(swift::reflection::TypeInfo const&) in libswiftReflection.a(TypeLowering.cpp.o) swift::reflection::TypeRefBuilder::dumpBuiltinTypeSection(llvm::raw_ostream&) in libswiftReflection.a(TypeRefBuilder.cpp.o) llvm::raw_ostream& PrintMetadataSource::printField<unsigned int>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned int const&) in libswiftReflection.a(MetadataSource.cpp.o) "llvm::errs()", referenced from: swift::reflection::TypeRef::dump() const in libswiftReflection.a(TypeRef.cpp.o) swift::reflection::TypeInfo::dump() const in libswiftReflection.a(TypeLowering.cpp.o) swift::reflection::ClosureContextInfo::dump() const in libswiftReflection.a(TypeRefBuilder.cpp.o) swift::reflection::MetadataSource::dump() const in libswiftReflection.a(MetadataSource.cpp.o) "llvm::outs()", referenced from: _swift_reflection_dumpTypeRef in SwiftRemoteMirror.cpp.o _swift_reflection_dumpInfoForTypeRef in SwiftRemoteMirror.cpp.o _swift_reflection_dumpInfoForMetadata in SwiftRemoteMirror.cpp.o _swift_reflection_dumpInfoForInstance in SwiftRemoteMirror.cpp.o ld: symbol(s) not found for architecture x86_64 clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation) [66/711] Building CXX object lib/IRGen/CMakeFiles/swiftIRGen.dir/GenFunc.cpp.o ninja: build stopped: subcommand failed. ./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting ```
Thanks! I'm not sure we can get away with using |
@jckarter I don't think any part of Reflection gets linked into the runtime at the moment, and there are no plans to do so. |
If it's not linked into the runtime, it shouldn't live in stdlib/. |
@slavapestov I still don't think any of Reflection's clients want to link in LLVM runtime libraries either. |
Can I try this one? Should I update this PR or create another PR? |
@nafu Sure, thanks for looking into it! It's up to you whether you want to update this PR or start a new one. |
@swift-ci please test |
Build failed |
Build failed |
Oops, it looks like we forgot about this one. I'm going to close the PR because the libraries have changed a lot since last year, but the bug's still available. |
Replace iostream with raw_ostream to follow LLVM Coding Standards.
With this PR, we still use iostream for reading in tools/swift-reflection-dump/swift-reflection-dump.cpp.
Resolves SR-7165.