Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 4 additions & 1 deletion llvm/lib/Transforms/IPO/LowerTypeTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ static cl::opt<DropTestKind>
"Drop all type test sequences")),
cl::Hidden, cl::init(DropTestKind::None));

static cl::opt<bool> DropTypeTestsLate("lowertypetests-drop-type-tests-late");

bool BitSetInfo::containsGlobalOffset(uint64_t Offset) const {
if (Offset < ByteOffset)
return false;
Expand Down Expand Up @@ -1075,7 +1077,8 @@ void LowerTypeTestsModule::importTypeTest(CallInst *CI) {
return;

TypeIdLowering TIL = importTypeId(TypeIdStr->getString());
Value *Lowered = lowerTypeTestCall(TypeIdStr, CI, TIL);
Value *Lowered = DropTypeTestsLate ? ConstantInt::getTrue(M.getContext())
: lowerTypeTestCall(TypeIdStr, CI, TIL);
if (Lowered) {
CI->replaceAllUsesWith(Lowered);
CI->eraseFromParent();
Expand Down
6 changes: 5 additions & 1 deletion llvm/tools/llvm-lto2/llvm-lto2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ template <typename T> static T check(ErrorOr<T> E, std::string Msg) {
}

static int usage() {
errs() << "Available subcommands: dump-symtab run\n";
errs() << "Available subcommands: dump-symtab run print-guid\n";
return 1;
}

Expand Down Expand Up @@ -610,5 +610,9 @@ int main(int argc, char **argv) {
return dumpSymtab(argc - 1, argv + 1);
if (Subcommand == "run")
return run(argc - 1, argv + 1);
if (Subcommand == "print-guid" && argc > 2) {
outs() << GlobalValue::getGUIDAssumingExternalLinkage(argv[2]) << '\n';
return 0;
}
return usage();
}
Loading