}
/// If N is compile unit return NULL otherwise return N.
-static MDNode *getNonCompileUnitScope(MDNode *N) {
- if (DIDescriptor(N).isCompileUnit())
+static MDScope *getNonCompileUnitScope(MDNode *N) {
+ if (!N || isa<MDCompileUnit>(N))
return nullptr;
- return N;
+ return cast<MDScope>(N);
}
DICompileUnit DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
AlignInBits, OffsetInBits, Flags);
}
-static Metadata *getConstantOrNull(Constant *C) {
+static ConstantAsMetadata *getConstantOrNull(Constant *C) {
if (C)
return ConstantAsMetadata::get(C);
return nullptr;