summaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-29 02:14:09 +0000
committerChris Lattner <sabre@nondot.org>2009-12-29 02:14:09 +0000
commitcafe9bba32aeed16e8e3db28b4cd4ff13160438f (patch)
treebfb7c4d1f2a2bf144d5525b22380806b86325c00 /lib/VMCore/Function.cpp
parent3990b121cf4a0b280ed3e54cf13870cbf4259e78 (diff)
downloadexternal_llvm-cafe9bba32aeed16e8e3db28b4cd4ff13160438f.zip
external_llvm-cafe9bba32aeed16e8e3db28b4cd4ff13160438f.tar.gz
external_llvm-cafe9bba32aeed16e8e3db28b4cd4ff13160438f.tar.bz2
add a layer of accessors around the Value::SubClassData member, and use
a convention (shadowing the setter with private forwarding function) to prevent subclasses from accidentally using it. This exposed some bogosity in ConstantExprs, which was propaging the opcode of the constant expr into the NUW/NSW/Exact field in the getWithOperands/getWithOperandReplaced methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92239 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 767f8a6..e04b6d6 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -160,7 +160,7 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
// If the function has arguments, mark them as lazily built.
if (Ty->getNumParams())
- SubclassData = 1; // Set the "has lazy arguments" bit.
+ setValueSubclassData(1); // Set the "has lazy arguments" bit.
// Make sure that we get added to a function
LeakDetector::addGarbageObject(this);
@@ -195,7 +195,8 @@ void Function::BuildLazyArguments() const {
}
// Clear the lazy arguments bit.
- const_cast<Function*>(this)->SubclassData &= ~1;
+ unsigned SDC = getSubclassDataFromValue();
+ const_cast<Function*>(this)->setValueSubclassData(SDC &= ~1);
}
size_t Function::arg_size() const {