diff options
author | Kevin Enderby <enderby@apple.com> | 2010-10-04 20:17:24 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2010-10-04 20:17:24 +0000 |
commit | 3f55c24df9527de345f6cc960944840a7a101c6a (patch) | |
tree | 30f8fb4b5322183a620261d679d41c49c69e2993 /lib/MC/MCContext.cpp | |
parent | f0233c6cd9e3f532f0611162c42b382d7a404dfe (diff) |
Incorporate suggestions by Daniel Dunbar after his review. Thanks Daniel!
1) Changed ValidateDwarfFileNumber() to isValidDwarfFileNumber() to be better
named. Since it is just a predicate and isn't actually changing any state.
2) Added a missing return in the comments for setCurrentDwarfLoc() in
include/llvm/MC/MCContext.h for fix formatting.
3) Changed clearDwarfLocSeen() to ClearDwarfLocSeen() since it does change
state.
4) Simplified the last test in isValidDwarfFileNumber() to just a one line
boolean test of MCDwarfFiles[FileNumber] != 0 for the final return statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCContext.cpp')
-rw-r--r-- | lib/MC/MCContext.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp index 1e65f87792..9c747d1041 100644 --- a/lib/MC/MCContext.cpp +++ b/lib/MC/MCContext.cpp @@ -255,15 +255,11 @@ unsigned MCContext::GetDwarfFile(StringRef FileName, unsigned FileNumber) { return FileNumber; } -/// ValidateDwarfFileNumber - takes a dwarf file number and returns true if it +/// isValidDwarfFileNumber - takes a dwarf file number and returns true if it /// currently is assigned and false otherwise. -bool MCContext::ValidateDwarfFileNumber(unsigned FileNumber) { +bool MCContext::isValidDwarfFileNumber(unsigned FileNumber) { if(FileNumber == 0 || FileNumber >= MCDwarfFiles.size()) return false; - MCDwarfFile *&ExistingFile = MCDwarfFiles[FileNumber]; - if (ExistingFile) - return true; - else - return false; + return MCDwarfFiles[FileNumber] != 0; } |