summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorGeorge Burgess IV <george.burgess.iv@gmail.com>2018-03-01 05:43:23 +0000
committerGeorge Burgess IV <george.burgess.iv@gmail.com>2018-03-01 05:43:23 +0000
commit00f70bd9337f19972da728185ac5c8410ca21e69 (patch)
treede502f7ffa65b4b2566f7eac90eb2ed7c21bd67b /clang/lib/CodeGen/CodeGenModule.cpp
parent05660dacedc14fa911d90317312cb613c3b776af (diff)
downloadbcm5719-llvm-00f70bd9337f19972da728185ac5c8410ca21e69.tar.gz
bcm5719-llvm-00f70bd9337f19972da728185ac5c8410ca21e69.zip
Remove redundant casts. NFC
So I wrote a clang-tidy check to lint out redundant `isa`, `cast`, and `dyn_cast`s for fun. This is a portion of what it found for clang; I plan to do similar cleanups in LLVM and other subprojects when I find time. Because of the volume of changes, I explicitly avoided making any change that wasn't highly local and obviously correct to me (e.g. we still have a number of foo(cast<Bar>(baz)) that I didn't touch, since overloading is a thing and the cast<Bar> did actually change the type -- just up the class hierarchy). I also tried to leave the types we were cast<>ing to somewhere nearby, in cases where it wasn't locally obvious what we were dealing with before. llvm-svn: 326416
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 217f9639ba7..389f586443c 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -2814,7 +2814,7 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName,
GetAddrOfGlobalVar(D, InitType, IsForDefinition));
// Erase the old global, since it is no longer used.
- cast<llvm::GlobalValue>(GV)->eraseFromParent();
+ GV->eraseFromParent();
GV = NewGV;
} else {
GV->setInitializer(Init);
OpenPOWER on IntegriCloud