[llvm] r265211 - Rename Context::discardValueNames() to shouldDiscardValueNames() (NFC)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 20:46:17 PDT 2016


Author: mehdi_amini
Date: Fri Apr  1 22:46:17 2016
New Revision: 265211

URL: http://llvm.org/viewvc/llvm-project?rev=265211&view=rev
Log:
Rename Context::discardValueNames() to shouldDiscardValueNames() (NFC)

Suggested by Sean Silva.

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/include/llvm/IR/LLVMContext.h
    llvm/trunk/lib/AsmParser/LLParser.cpp
    llvm/trunk/lib/IR/LLVMContext.cpp
    llvm/trunk/lib/IR/Value.cpp

Modified: llvm/trunk/include/llvm/IR/LLVMContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/LLVMContext.h?rev=265211&r1=265210&r2=265211&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/LLVMContext.h (original)
+++ llvm/trunk/include/llvm/IR/LLVMContext.h Fri Apr  1 22:46:17 2016
@@ -108,7 +108,7 @@ public:
   /// Return true if the Context runtime configuration is set to discard all
   /// value names. When true, only GlobalValue names will be available in the
   /// IR.
-  bool discardValueNames() const;
+  bool shouldDiscardValueNames() const;
 
   /// Set the Context runtime configuration to discard all value name (but
   /// GlobalValue). Clients can use this flag to save memory and runtime,

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=265211&r1=265210&r2=265211&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Fri Apr  1 22:46:17 2016
@@ -46,7 +46,7 @@ bool LLParser::Run() {
   // Prime the lexer.
   Lex.Lex();
 
-  if (Context.discardValueNames())
+  if (Context.shouldDiscardValueNames())
     return Error(
         Lex.getLoc(),
         "Can't read textual IR with a Context that discards named Values");

Modified: llvm/trunk/lib/IR/LLVMContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContext.cpp?rev=265211&r1=265210&r2=265211&view=diff
==============================================================================
--- llvm/trunk/lib/IR/LLVMContext.cpp (original)
+++ llvm/trunk/lib/IR/LLVMContext.cpp Fri Apr  1 22:46:17 2016
@@ -313,7 +313,7 @@ void LLVMContext::deleteGC(const Functio
   pImpl->GCNames.erase(&Fn);
 }
 
-bool LLVMContext::discardValueNames() const { return pImpl->DiscardValueNames; }
+bool LLVMContext::shouldDiscardValueNames() const { return pImpl->DiscardValueNames; }
 
 void LLVMContext::setDiscardValueNames(bool Discard) {
   pImpl->DiscardValueNames = Discard;

Modified: llvm/trunk/lib/IR/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Value.cpp?rev=265211&r1=265210&r2=265211&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Value.cpp (original)
+++ llvm/trunk/lib/IR/Value.cpp Fri Apr  1 22:46:17 2016
@@ -199,7 +199,7 @@ StringRef Value::getName() const {
 
 void Value::setNameImpl(const Twine &NewName) {
   // Fast-path: LLVMContext can be set to strip out non-GlobalValue names
-  if (getContext().discardValueNames() && !isa<GlobalValue>(this))
+  if (getContext().shouldDiscardValueNames() && !isa<GlobalValue>(this))
     return;
 
   // Fast path for common IRBuilder case of setName("") when there is no name.




More information about the llvm-commits mailing list