index 9e44635d72f7a5f2231be161e5bb457c913425c2..3e7764c85dba2fa31241517bc0a79aa8fa4e1616 100644 (file)
FlagObjectPointer = 1 << 10,
FlagVector = 1 << 11,
FlagStaticMember = 1 << 12,
- FlagIndirectVariable = 1 << 13,
- FlagLValueReference = 1 << 14,
- FlagRValueReference = 1 << 15
+ FlagLValueReference = 1 << 13,
+ FlagRValueReference = 1 << 14
};
protected:
return (getHeaderFieldAs<unsigned>(3) & FlagObjectPointer) != 0;
}
- /// \brief Return true if this variable is represented as a pointer.
- bool isIndirect() const {
- return (getHeaderFieldAs<unsigned>(3) & FlagIndirectVariable) != 0;
- }
-
/// \brief If this variable is inlined then return inline location.
MDNode *getInlinedAt() const;
public:
explicit DILocation(const MDNode *N) : DIDescriptor(N) {}
- unsigned getLineNumber() const { return getUnsignedField(0); }
- unsigned getColumnNumber() const { return getUnsignedField(1); }
- DIScope getScope() const { return getFieldAs<DIScope>(2); }
- DILocation getOrigLocation() const { return getFieldAs<DILocation>(3); }
+ unsigned getLineNumber() const {
+ if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode))
+ return L->getLine();
+ return 0;
+ }
+ unsigned getColumnNumber() const {
+ if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode))
+ return L->getColumn();
+ return 0;
+ }
+ DIScope getScope() const {
+ if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode))
+ return DIScope(dyn_cast_or_null<MDNode>(L->getScope()));
+ return DIScope(nullptr);
+ }
+ DILocation getOrigLocation() const {
+ if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode))
+ return DILocation(dyn_cast_or_null<MDNode>(L->getInlinedAt()));
+ return DILocation(nullptr);
+ }
StringRef getFilename() const { return getScope().getFilename(); }
StringRef getDirectory() const { return getScope().getDirectory(); }
bool Verify() const;
// sure this location is a lexical block before retrieving its
// value.
return getScope().isLexicalBlockFile()
- ? getFieldAs<DILexicalBlockFile>(2).getDiscriminator()
+ ? DILexicalBlockFile(
+ cast<MDNode>(cast<MDLocation>(DbgNode)->getScope()))
+ .getDiscriminator()
: 0;
}
/// \brief Process DILocation.
void processLocation(const Module &M, DILocation Loc);
+ /// \brief Process DIExpression.
+ void processExpression(DIExpression Expr);
+
/// \brief Clear all lists.
void reset();