Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion llvm/include/llvm/Support/TypeSize.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define LLVM_SUPPORT_TYPESIZE_H

#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"

Expand Down Expand Up @@ -371,7 +372,14 @@ class TypeSize : public details::FixedOrScalableQuantity<TypeSize, uint64_t> {
// else
// bail out early for scalable vectors and use getFixedValue()
// }
LLVM_ABI operator ScalarTy() const;
operator ScalarTy() const {
if (isScalable()) {
reportFatalInternalError(
"Cannot implicitly convert a scalable size to a fixed-width size in "
"`TypeSize::operator ScalarTy()`");
}
return getFixedValue();
}

// Additional operators needed to avoid ambiguous parses
// because of the implicit conversion hack.
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ add_llvm_component_library(LLVMSupport
ToolOutputFile.cpp
TrieRawHashMap.cpp
Twine.cpp
TypeSize.cpp
Unicode.cpp
UnicodeCaseFold.cpp
UnicodeNameToCodepoint.cpp
Expand Down
22 changes: 0 additions & 22 deletions llvm/lib/Support/TypeSize.cpp

This file was deleted.