[llvm] r239277 - [TableGen] Remove unnecessary default constructed SMLoc that just existed to return. Instead just call the default constructor in the return.
Craig Topper
craig.topper at gmail.com
Sun Jun 7 18:35:45 PDT 2015
Author: ctopper
Date: Sun Jun 7 20:35:45 2015
New Revision: 239277
URL: http://llvm.org/viewvc/llvm-project?rev=239277&view=rev
Log:
[TableGen] Remove unnecessary default constructed SMLoc that just existed to return. Instead just call the default constructor in the return.
Modified:
llvm/trunk/utils/TableGen/CTagsEmitter.cpp
Modified: llvm/trunk/utils/TableGen/CTagsEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CTagsEmitter.cpp?rev=239277&r1=239276&r2=239277&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CTagsEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/CTagsEmitter.cpp Sun Jun 7 20:35:45 2015
@@ -59,11 +59,7 @@ private:
SMLoc CTagsEmitter::locate(const Record *R) {
ArrayRef<SMLoc> Locs = R->getLoc();
- if (Locs.empty()) {
- SMLoc NullLoc;
- return NullLoc;
- }
- return Locs.front();
+ return !Locs.empty() ? Locs.front() : SMLoc();
}
void CTagsEmitter::run(raw_ostream &OS) {
More information about the llvm-commits
mailing list