Rename Context::discardValueNames() to shouldDiscardValueNames() (NFC)

Suggested by Sean Silva.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 265211
This commit is contained in:
Mehdi Amini 2016-04-02 03:46:17 +00:00
parent c2822bd3d1
commit 50af49fcdc
4 changed files with 4 additions and 4 deletions

View File

@ -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,

View File

@ -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");

View File

@ -313,7 +313,7 @@ void LLVMContext::deleteGC(const Function &Fn) {
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;

View File

@ -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.