================
@@ -198,13 +199,20 @@ static int PrintSupportedExtensions(std::string
TargetStr) {
std::unique_ptr<llvm::TargetMachine> TheTargetMachine(
TheTarget->createTargetMachine(TargetStr, "", "", Options,
std::nullopt));
const llvm::Triple &MachineTriple = TheTargetMachine->getTargetTriple();
+ const llvm::MCSubtargetInfo *MCInfo = TheTargetMachine->getMCSubtargetInfo();
----------------
DavidSpickett wrote:
I just thought of one more thing. What happens here if the build was configured
without the target backend enabled?
For example if CMake was configred with `-DLLVM_TARGETS_TO_BUILD=ARM`, and you
ask for the RISC-V extensions, does clang crash?
Though that is an unusual thing to do, but it is possible since clang knows
about all possible triples even without a target backend. And besides that,
clang shouldn't crash anyway. Simplest solution is to pass an empty description
map I think, and add a test for that situation.
https://github.com/llvm/llvm-project/pull/66715
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits