-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[rebranch] Fix compilation failures #40168
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
Conversation
llvm-project `ErrorHandling.h` was updated to remove std::string. This added a new `report_fatal_error` overload taking a `const Twine &`, removed the overload that took `const std::string &`, and updated `fatal_error_handler_t` to use `const char *` rather than `const std::string &`. Fix uses of these functions to take into account these updates. Note that without the `const std::string &` overload, passing a `std::string` into `report_fatal_error` now results in an ambiguous match between the `StringRef` and `Twine` overloads so we need to be explicit about one or the other.
llvm-project 601102d282d5e9a1429fea52ee17303aec8a7c10 renamed various functions in `CharInfo.h` and `Lexer.h`. Rename uses in Swift.
llvm-project updated `hashExtension` in 655bea4226b401a11164f99c6344e38d8742b8e4 to use a `HashBuilder` rather than `hash_code`. Update use in ClangImporter.
@swift-ci please test |
auto attrs = llvm::AttributeList::get(IGM.getLLVMContext(), | ||
llvm::AttributeList::FunctionIndex, | ||
llvm::Attribute::NoUnwind); | ||
|
||
llvm::CallInst *call = | ||
Builder.CreateCall(IGM.getAllocBoxFn(), typeMetadata); | ||
call->setAttributes(attrs); | ||
call->addFnAttr(llvm::Attribute::NoUnwind); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jckarter was this specifically replacing all attributes added in CreateCall
or is using add
okay (there's a few other cases like this)? The LLVM commits mention possibly hiding AttributeList::AttrIndex
in the future so I tried to use the new add(Fn|Param|Ret)*
methods where possible. There's just a single FirstArgIndex
remaining, used in a replace*
method that doesn't have a (Fn|Param|Ret)
equivalent at the moment.
If setAttributes
is used here on purpose I can just change this to llvm::AttributeList().addFnAttr...
instead.
@@ -38,11 +38,11 @@ struct WidthPreservingAPIntDenseMapInfo { | |||
} | |||
|
|||
static unsigned getHashValue(const APInt &Key) { | |||
return static_cast<unsigned>(hash_value(Key)); | |||
return llvm::DenseMapInfo<APInt>::getHashValue(Key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjmccall any objections to this change? I'm actually not sure what header is no longer including Hashing.h
but this avoids including any extra entirely 🤷
The functions in llvm-project `AttributeList` have been renamed/refactored to help remove uses of `AttributeList::*Index`. Update to use these new functions where possible. There's one use of `AttrIndex` remaining as `replaceAttributeTypeAtIndex` still takes the index and there is no `param` equivalent. We could add one locally, but presumably that will be added eventually.
`WidthPreservingAPIntDenseMapInfo` uses the same `getHashValue` and `isEqual` as the normal `DenseMapInfo` but with different empty and tombstone keys. `hash_value` is no longer a complete type, so just delegate to `DenseMapInfo<APInt>` rather than add another `#include`.
`CoverageFilenamesSectionWriter` now takes an `ArrayRef<std::string>` rather than `ArrayRef<StringRef>`. stable/20210726 reverted that change so that the coverage formats were the same. stable/20211026 doesn't have that revert though.
f48cb2b
to
381d053
Compare
@@ -188,22 +188,22 @@ getAccessorForComputedComponent(IRGenModule &IGM, | |||
case Getter: | |||
// Original accessor's args should be @in or @out, meaning they won't be | |||
// captured or aliased. | |||
accessorThunk->addAttribute(1, llvm::Attribute::NoCapture); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jckarter I'm fairly sure this is correct, but if you want to double check that'd be great :). addParamAttr
eventually adds FirstArgIndex
, which is 1.
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
Going to merge since this is now compiling at least. I can do any fixes to the above later. |
Haven't run any tests yet, but this at least fixes all the macOS compilation failures.