summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LexicalScopes.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-04-14 00:51:57 +0000
committerCraig Topper <craig.topper@gmail.com>2014-04-14 00:51:57 +0000
commit4ba844388c586ee40871a52dc9d6eab883fde1b7 (patch)
treee58f9eb46c2ea69c44c2b06a9cae04291ce5ae68 /lib/CodeGen/LexicalScopes.cpp
parentb9ed50cf1772205b5a8f3ce2b604d01f9335e360 (diff)
downloadllvm-4ba844388c586ee40871a52dc9d6eab883fde1b7.tar.gz
llvm-4ba844388c586ee40871a52dc9d6eab883fde1b7.tar.bz2
llvm-4ba844388c586ee40871a52dc9d6eab883fde1b7.tar.xz
[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206142 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LexicalScopes.cpp')
-rw-r--r--lib/CodeGen/LexicalScopes.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/CodeGen/LexicalScopes.cpp b/lib/CodeGen/LexicalScopes.cpp
index c22ab11f7a..a5640091f7 100644
--- a/lib/CodeGen/LexicalScopes.cpp
+++ b/lib/CodeGen/LexicalScopes.cpp
@@ -30,8 +30,8 @@ LexicalScopes::~LexicalScopes() { reset(); }
/// reset - Reset the instance so that it's prepared for another function.
void LexicalScopes::reset() {
- MF = NULL;
- CurrentFnLexicalScope = NULL;
+ MF = nullptr;
+ CurrentFnLexicalScope = nullptr;
DeleteContainerSeconds(LexicalScopeMap);
DeleteContainerSeconds(AbstractScopeMap);
InlinedLexicalScopeMap.clear();
@@ -60,8 +60,8 @@ void LexicalScopes::extractLexicalScopes(
// Scan each instruction and create scopes. First build working set of scopes.
for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E;
++I) {
- const MachineInstr *RangeBeginMI = NULL;
- const MachineInstr *PrevMI = NULL;
+ const MachineInstr *RangeBeginMI = nullptr;
+ const MachineInstr *PrevMI = nullptr;
DebugLoc PrevDL;
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
II != IE; ++II) {
@@ -113,11 +113,11 @@ void LexicalScopes::extractLexicalScopes(
/// findLexicalScope - Find lexical scope, either regular or inlined, for the
/// given DebugLoc. Return NULL if not found.
LexicalScope *LexicalScopes::findLexicalScope(DebugLoc DL) {
- MDNode *Scope = NULL;
- MDNode *IA = NULL;
+ MDNode *Scope = nullptr;
+ MDNode *IA = nullptr;
DL.getScopeAndInlinedAt(Scope, IA, MF->getFunction()->getContext());
if (!Scope)
- return NULL;
+ return nullptr;
// The scope that we were created with could have an extra file - which
// isn't what we care about in this case.
@@ -133,8 +133,8 @@ LexicalScope *LexicalScopes::findLexicalScope(DebugLoc DL) {
/// getOrCreateLexicalScope - Find lexical scope for the given DebugLoc. If
/// not available then create new lexical scope.
LexicalScope *LexicalScopes::getOrCreateLexicalScope(DebugLoc DL) {
- MDNode *Scope = NULL;
- MDNode *InlinedAt = NULL;
+ MDNode *Scope = nullptr;
+ MDNode *InlinedAt = nullptr;
DL.getScopeAndInlinedAt(Scope, InlinedAt, MF->getFunction()->getContext());
if (InlinedAt) {
@@ -159,10 +159,10 @@ LexicalScope *LexicalScopes::getOrCreateRegularScope(MDNode *Scope) {
if (WScope)
return WScope;
- LexicalScope *Parent = NULL;
+ LexicalScope *Parent = nullptr;
if (D.isLexicalBlock())
Parent = getOrCreateLexicalScope(DebugLoc::getFromDILexicalBlock(Scope));
- WScope = new LexicalScope(Parent, DIDescriptor(Scope), NULL, false);
+ WScope = new LexicalScope(Parent, DIDescriptor(Scope), nullptr, false);
LexicalScopeMap.insert(std::make_pair(Scope, WScope));
if (!Parent && DIDescriptor(Scope).isSubprogram() &&
DISubprogram(Scope).describes(MF->getFunction()))
@@ -197,13 +197,13 @@ LexicalScope *LexicalScopes::getOrCreateAbstractScope(const MDNode *N) {
if (AScope)
return AScope;
- LexicalScope *Parent = NULL;
+ LexicalScope *Parent = nullptr;
if (Scope.isLexicalBlock()) {
DILexicalBlock DB(N);
DIDescriptor ParentDesc = DB.getContext();
Parent = getOrCreateAbstractScope(ParentDesc);
}
- AScope = new LexicalScope(Parent, DIDescriptor(N), NULL, true);
+ AScope = new LexicalScope(Parent, DIDescriptor(N), nullptr, true);
AbstractScopeMap[N] = AScope;
if (DIDescriptor(N).isSubprogram())
AbstractScopesList.push_back(AScope);
@@ -244,7 +244,7 @@ void LexicalScopes::assignInstructionRanges(
SmallVectorImpl<InsnRange> &MIRanges,
DenseMap<const MachineInstr *, LexicalScope *> &MI2ScopeMap) {
- LexicalScope *PrevLexicalScope = NULL;
+ LexicalScope *PrevLexicalScope = nullptr;
for (SmallVectorImpl<InsnRange>::const_iterator RI = MIRanges.begin(),
RE = MIRanges.end();
RI != RE; ++RI) {