80-column and whitespace fixups.

llvm-svn: 168344
This commit is contained in:
Eric Christopher 2012-11-20 00:15:36 +00:00
parent b3d5d71dfa
commit b1d992fb35
2 changed files with 54 additions and 52 deletions

View File

@ -215,9 +215,9 @@ namespace llvm {
}
StringRef getFilename() const { return getStringField(1); }
StringRef getDirectory() const { return getStringField(2); }
DICompileUnit getCompileUnit() const{
DICompileUnit getCompileUnit() const{
assert (getVersion() <= LLVMDebugVersion10 && "Invalid CompileUnit!");
return getFieldAs<DICompileUnit>(3);
return getFieldAs<DICompileUnit>(3);
}
};
@ -252,11 +252,11 @@ namespace llvm {
DIScope getContext() const { return getFieldAs<DIScope>(1); }
StringRef getName() const { return getStringField(2); }
DICompileUnit getCompileUnit() const{
DICompileUnit getCompileUnit() const{
assert (getVersion() <= LLVMDebugVersion10 && "Invalid getCompileUnit!");
if (getVersion() == llvm::LLVMDebugVersion7)
return getFieldAs<DICompileUnit>(3);
return getFieldAs<DIFile>(3).getCompileUnit();
}
DIFile getFile() const { return getFieldAs<DIFile>(3); }
@ -298,13 +298,13 @@ namespace llvm {
bool isValid() const {
return DbgNode && (isBasicType() || isDerivedType() || isCompositeType());
}
StringRef getDirectory() const {
StringRef getDirectory() const {
if (getVersion() == llvm::LLVMDebugVersion7)
return getCompileUnit().getDirectory();
return getFieldAs<DIFile>(3).getDirectory();
}
StringRef getFilename() const {
StringRef getFilename() const {
if (getVersion() == llvm::LLVMDebugVersion7)
return getCompileUnit().getFilename();
@ -349,14 +349,14 @@ namespace llvm {
/// return base type size.
uint64_t getOriginalTypeSize() const;
/// getObjCProperty - Return property node, if this ivar is
/// getObjCProperty - Return property node, if this ivar is
/// associated with one.
MDNode *getObjCProperty() const;
StringRef getObjCPropertyName() const {
StringRef getObjCPropertyName() const {
if (getVersion() > LLVMDebugVersion11)
return StringRef();
return getStringField(10);
return getStringField(10);
}
StringRef getObjCPropertyGetterName() const {
assert (getVersion() <= LLVMDebugVersion11 && "Invalid Request");
@ -427,10 +427,10 @@ namespace llvm {
DIScope getContext() const { return getFieldAs<DIScope>(1); }
StringRef getName() const { return getStringField(2); }
DIType getType() const { return getFieldAs<DIType>(3); }
StringRef getFilename() const {
StringRef getFilename() const {
return getFieldAs<DIFile>(4).getFilename();
}
StringRef getDirectory() const {
StringRef getDirectory() const {
return getFieldAs<DIFile>(4).getDirectory();
}
unsigned getLineNumber() const { return getUnsignedField(5); }
@ -446,10 +446,10 @@ namespace llvm {
StringRef getName() const { return getStringField(2); }
DIType getType() const { return getFieldAs<DIType>(3); }
uint64_t getValue() const { return getUInt64Field(4); }
StringRef getFilename() const {
StringRef getFilename() const {
return getFieldAs<DIFile>(5).getFilename();
}
StringRef getDirectory() const {
StringRef getDirectory() const {
return getFieldAs<DIFile>(5).getDirectory();
}
unsigned getLineNumber() const { return getUnsignedField(6); }
@ -467,12 +467,12 @@ namespace llvm {
StringRef getName() const { return getStringField(3); }
StringRef getDisplayName() const { return getStringField(4); }
StringRef getLinkageName() const { return getStringField(5); }
DICompileUnit getCompileUnit() const{
DICompileUnit getCompileUnit() const{
assert (getVersion() <= LLVMDebugVersion10 && "Invalid getCompileUnit!");
if (getVersion() == llvm::LLVMDebugVersion7)
return getFieldAs<DICompileUnit>(6);
return getFieldAs<DIFile>(6).getCompileUnit();
return getFieldAs<DIFile>(6).getCompileUnit();
}
unsigned getLineNumber() const { return getUnsignedField(7); }
DICompositeType getType() const { return getFieldAs<DICompositeType>(8); }
@ -502,33 +502,33 @@ namespace llvm {
return getFieldAs<DICompositeType>(13);
}
unsigned isArtificial() const {
unsigned isArtificial() const {
if (getVersion() <= llvm::LLVMDebugVersion8)
return getUnsignedField(14);
return getUnsignedField(14);
return (getUnsignedField(14) & FlagArtificial) != 0;
}
/// isPrivate - Return true if this subprogram has "private"
/// access specifier.
bool isPrivate() const {
bool isPrivate() const {
if (getVersion() <= llvm::LLVMDebugVersion8)
return false;
return (getUnsignedField(14) & FlagPrivate) != 0;
}
/// isProtected - Return true if this subprogram has "protected"
/// access specifier.
bool isProtected() const {
bool isProtected() const {
if (getVersion() <= llvm::LLVMDebugVersion8)
return false;
return (getUnsignedField(14) & FlagProtected) != 0;
}
/// isExplicit - Return true if this subprogram is marked as explicit.
bool isExplicit() const {
bool isExplicit() const {
if (getVersion() <= llvm::LLVMDebugVersion8)
return false;
return (getUnsignedField(14) & FlagExplicit) != 0;
}
/// isPrototyped - Return true if this subprogram is prototyped.
bool isPrototyped() const {
bool isPrototyped() const {
if (getVersion() <= llvm::LLVMDebugVersion8)
return false;
return (getUnsignedField(14) & FlagPrototyped) != 0;
@ -536,18 +536,18 @@ namespace llvm {
unsigned isOptimized() const;
StringRef getFilename() const {
StringRef getFilename() const {
if (getVersion() == llvm::LLVMDebugVersion7)
return getCompileUnit().getFilename();
return getFieldAs<DIFile>(6).getFilename();
return getFieldAs<DIFile>(6).getFilename();
}
StringRef getDirectory() const {
StringRef getDirectory() const {
if (getVersion() == llvm::LLVMDebugVersion7)
return getCompileUnit().getFilename();
return getFieldAs<DIFile>(6).getDirectory();
return getFieldAs<DIFile>(6).getDirectory();
}
/// getScopeLineNumber - Get the beginning of the scope of the
@ -583,25 +583,25 @@ namespace llvm {
StringRef getName() const { return getStringField(3); }
StringRef getDisplayName() const { return getStringField(4); }
StringRef getLinkageName() const { return getStringField(5); }
DICompileUnit getCompileUnit() const{
DICompileUnit getCompileUnit() const{
assert (getVersion() <= LLVMDebugVersion10 && "Invalid getCompileUnit!");
if (getVersion() == llvm::LLVMDebugVersion7)
return getFieldAs<DICompileUnit>(6);
DIFile F = getFieldAs<DIFile>(6);
DIFile F = getFieldAs<DIFile>(6);
return F.getCompileUnit();
}
StringRef getFilename() const {
if (getVersion() <= llvm::LLVMDebugVersion10)
return getContext().getFilename();
return getFieldAs<DIFile>(6).getFilename();
}
}
StringRef getDirectory() const {
if (getVersion() <= llvm::LLVMDebugVersion10)
return getContext().getDirectory();
return getFieldAs<DIFile>(6).getDirectory();
}
}
unsigned getLineNumber() const { return getUnsignedField(7); }
DIType getType() const { return getFieldAs<DIType>(8); }
@ -626,25 +626,25 @@ namespace llvm {
DIScope getContext() const { return getFieldAs<DIScope>(1); }
StringRef getName() const { return getStringField(2); }
DICompileUnit getCompileUnit() const {
DICompileUnit getCompileUnit() const {
assert (getVersion() <= LLVMDebugVersion10 && "Invalid getCompileUnit!");
if (getVersion() == llvm::LLVMDebugVersion7)
return getFieldAs<DICompileUnit>(3);
DIFile F = getFieldAs<DIFile>(3);
DIFile F = getFieldAs<DIFile>(3);
return F.getCompileUnit();
}
unsigned getLineNumber() const {
return (getUnsignedField(4) << 8) >> 8;
unsigned getLineNumber() const {
return (getUnsignedField(4) << 8) >> 8;
}
unsigned getArgNumber() const {
unsigned L = getUnsignedField(4);
unsigned L = getUnsignedField(4);
return L >> 24;
}
DIType getType() const { return getFieldAs<DIType>(5); }
/// isArtificial - Return true if this variable is marked as "artificial".
bool isArtificial() const {
bool isArtificial() const {
if (getVersion() <= llvm::LLVMDebugVersion8)
return false;
return (getUnsignedField(6) & FlagArtificial) != 0;
@ -666,7 +666,7 @@ namespace llvm {
}
unsigned getNumAddrElements() const;
uint64_t getAddrElement(unsigned Idx) const {
if (getVersion() <= llvm::LLVMDebugVersion8)
return getUInt64Field(Idx+6);
@ -726,23 +726,23 @@ namespace llvm {
};
/// DINameSpace - A wrapper for a C++ style name space.
class DINameSpace : public DIScope {
class DINameSpace : public DIScope {
public:
explicit DINameSpace(const MDNode *N = 0) : DIScope(N) {}
DIScope getContext() const { return getFieldAs<DIScope>(1); }
StringRef getName() const { return getStringField(2); }
StringRef getDirectory() const {
StringRef getDirectory() const {
return getFieldAs<DIFile>(3).getDirectory();
}
StringRef getFilename() const {
StringRef getFilename() const {
return getFieldAs<DIFile>(3).getFilename();
}
DICompileUnit getCompileUnit() const{
DICompileUnit getCompileUnit() const{
assert (getVersion() <= LLVMDebugVersion10 && "Invalid getCompileUnit!");
if (getVersion() == llvm::LLVMDebugVersion7)
return getFieldAs<DICompileUnit>(3);
return getFieldAs<DIFile>(3).getCompileUnit();
return getFieldAs<DIFile>(3).getCompileUnit();
}
unsigned getLineNumber() const { return getUnsignedField(4); }
bool Verify() const;
@ -818,7 +818,7 @@ namespace llvm {
/// to hold function specific information.
NamedMDNode *getOrInsertFnSpecificMDNode(Module &M, DISubprogram SP);
/// getFnSpecificMDNode - Return a NameMDNode, if available, that is
/// getFnSpecificMDNode - Return a NameMDNode, if available, that is
/// suitable to hold function specific information.
NamedMDNode *getFnSpecificMDNode(const Module &M, DISubprogram SP);

View File

@ -68,7 +68,8 @@ uint64_t DIDescriptor::getUInt64Field(unsigned Elt) const {
return 0;
if (Elt < DbgNode->getNumOperands())
if (ConstantInt *CI = dyn_cast_or_null<ConstantInt>(DbgNode->getOperand(Elt)))
if (ConstantInt *CI
= dyn_cast_or_null<ConstantInt>(DbgNode->getOperand(Elt)))
return CI->getZExtValue();
return 0;
@ -691,7 +692,7 @@ static void fixupObjcLikeName(StringRef Str, SmallVectorImpl<char> &Out) {
}
}
/// getFnSpecificMDNode - Return a NameMDNode, if available, that is
/// getFnSpecificMDNode - Return a NameMDNode, if available, that is
/// suitable to hold function specific information.
NamedMDNode *llvm::getFnSpecificMDNode(const Module &M, DISubprogram Fn) {
SmallString<32> Name = StringRef("llvm.dbg.lv.");
@ -720,7 +721,7 @@ NamedMDNode *llvm::getOrInsertFnSpecificMDNode(Module &M, DISubprogram Fn) {
if (FName.startswith(StringRef(&One, 1)))
FName = FName.substr(1);
fixupObjcLikeName(FName, Name);
return M.getOrInsertNamedMetadata(Name.str());
}
@ -743,7 +744,7 @@ DIVariable llvm::cleanseInlinedVariable(MDNode *DV, LLVMContext &VMContext) {
SmallVector<Value *, 16> Elts;
// Insert inlined scope as 7th element.
for (unsigned i = 0, e = DV->getNumOperands(); i != e; ++i)
i == 7 ?
i == 7 ?
Elts.push_back(Constant::getNullValue(Type::getInt32Ty(VMContext))):
Elts.push_back(DV->getOperand(i));
return DIVariable(MDNode::get(VMContext, Elts));
@ -757,7 +758,7 @@ DISubprogram llvm::getDISubprogram(const MDNode *Scope) {
if (D.isLexicalBlockFile())
return getDISubprogram(DILexicalBlockFile(Scope).getContext());
if (D.isLexicalBlock())
return getDISubprogram(DILexicalBlock(Scope).getContext());
@ -820,9 +821,10 @@ void DebugInfoFinder::processModule(const Module &M) {
}
for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I)
for (Function::const_iterator FI = (*I).begin(), FE = (*I).end(); FI != FE; ++FI)
for (BasicBlock::const_iterator BI = (*FI).begin(), BE = (*FI).end(); BI != BE;
++BI) {
for (Function::const_iterator FI = (*I).begin(), FE = (*I).end();
FI != FE; ++FI)
for (BasicBlock::const_iterator BI = (*FI).begin(), BE = (*FI).end();
BI != BE; ++BI) {
if (const DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI))
processDeclare(DDI);
@ -1065,7 +1067,7 @@ void DIType::printInternal(raw_ostream &OS) const {
<< ", align " << getAlignInBits()
<< ", offset " << getOffsetInBits();
if (isBasicType())
if (const char *Enc =
if (const char *Enc =
dwarf::AttributeEncodingString(DIBasicType(DbgNode).getEncoding()))
OS << ", enc " << Enc;
OS << "]";