diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2016-11-03 02:21:43 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2016-11-03 02:21:43 +0000 |
commit | 70d15b36e5200b6a7abf58e411d651573b8a8080 (patch) | |
tree | 7d3a86957851d810bfcc1e1a96689da149f6e514 /clang/lib/CodeGen/CGExprConstant.cpp | |
parent | e4e9e281a1fbc915b6567a003fd21cc5492cde65 (diff) | |
download | llvm-70d15b36e5200b6a7abf58e411d651573b8a8080.zip llvm-70d15b36e5200b6a7abf58e411d651573b8a8080.tar.gz llvm-70d15b36e5200b6a7abf58e411d651573b8a8080.tar.bz2 |
[CodeGen] Use StringRef. NFC.
Looks like CurFn's name outlives FunctionName, so we can just pass
StringRefs around rather than going from a StringRef to a std::string
to a const char* to a StringRef.
llvm-svn: 285873
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index c268c03..cf83456 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -1086,7 +1086,7 @@ public: return CGM.GetAddrOfConstantCFString(Literal); } case Expr::BlockExprClass: { - std::string FunctionName; + StringRef FunctionName; if (CGF) FunctionName = CGF->CurFn->getName(); else @@ -1094,7 +1094,7 @@ public: // This is not really an l-value. llvm::Constant *Ptr = - CGM.GetAddrOfGlobalBlock(cast<BlockExpr>(E), FunctionName.c_str()); + CGM.GetAddrOfGlobalBlock(cast<BlockExpr>(E), FunctionName); return ConstantAddress(Ptr, CGM.getPointerAlign()); } case Expr::CXXTypeidExprClass: { |