Add def file for semantics attributes and use constants instead of cstring literals

This commit is contained in:
zoecarver
2019-11-02 11:36:13 -07:00
parent 74328cdda2
commit d4129d8659
12 changed files with 130 additions and 23 deletions

View File

@@ -12,6 +12,7 @@
#define DEBUG_TYPE "objectoutliner"
#include "swift/AST/ASTMangler.h"
#include "swift/Basic/Semantics.h"
#include "swift/SIL/DebugUtils.h"
#include "swift/SIL/SILBuilder.h"
#include "swift/SILOptimizer/PassManager/Transforms.h"
@@ -148,7 +149,7 @@ bool ObjectOutliner::isValidUseOfObject(SILInstruction *I, bool isCOWObject,
// There should only be a single call to findStringSwitchCase. But even
// if there are multiple calls, it's not problem - we'll just optimize the
// last one we find.
if (cast<ApplyInst>(I)->hasSemantics("findStringSwitchCase"))
if (cast<ApplyInst>(I)->hasSemantics(FIND_STRING_SWITCH_CASE))
*FindStringCall = cast<ApplyInst>(I);
return true;