Skip to content

Commit 5cae9dd

Browse files
committed
[𝘀𝗽𝗿] initial version
Created using spr 1.3.6-beta.1
2 parents 3e6a704 + b0cd0e2 commit 5cae9dd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

llvm/lib/Transforms/IPO/LowerTypeTests.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ static cl::opt<DropTestKind>
132132
"Drop all type test sequences")),
133133
cl::Hidden, cl::init(DropTestKind::None));
134134

135+
static cl::opt<bool> DropTypeTestsLate("lowertypetests-drop-type-tests-late");
136+
135137
bool BitSetInfo::containsGlobalOffset(uint64_t Offset) const {
136138
if (Offset < ByteOffset)
137139
return false;
@@ -1075,7 +1077,8 @@ void LowerTypeTestsModule::importTypeTest(CallInst *CI) {
10751077
return;
10761078

10771079
TypeIdLowering TIL = importTypeId(TypeIdStr->getString());
1078-
Value *Lowered = lowerTypeTestCall(TypeIdStr, CI, TIL);
1080+
Value *Lowered = DropTypeTestsLate ? ConstantInt::getTrue(M.getContext())
1081+
: lowerTypeTestCall(TypeIdStr, CI, TIL);
10791082
if (Lowered) {
10801083
CI->replaceAllUsesWith(Lowered);
10811084
CI->eraseFromParent();

llvm/tools/llvm-lto2/llvm-lto2.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ template <typename T> static T check(ErrorOr<T> E, std::string Msg) {
247247
}
248248

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

@@ -610,5 +610,7 @@ int main(int argc, char **argv) {
610610
return dumpSymtab(argc - 1, argv + 1);
611611
if (Subcommand == "run")
612612
return run(argc - 1, argv + 1);
613+
if (Subcommand == "print-guid" && argc > 2)
614+
outs() << GlobalValue::getGUIDAssumingExternalLinkage(argv[2]);
613615
return usage();
614616
}

0 commit comments

Comments
 (0)