summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitb9c8651b8cf963e6f286d6b44a4cababba225994 (patch)
tree38c3897ed778f57d0afd3ef59a0941de8a497f2d /llvm/lib/VMCore/Function.cpp
parent9f021fd05d07e60a9bf3a7ff7969e15ad1cbdb2c (diff)
downloadbcm5719-llvm-b9c8651b8cf963e6f286d6b44a4cababba225994.tar.gz
bcm5719-llvm-b9c8651b8cf963e6f286d6b44a4cababba225994.zip
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. llvm-svn: 92239
Diffstat (limited to 'llvm/lib/VMCore/Function.cpp')
-rw-r--r--llvm/lib/VMCore/Function.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 767f8a613ca..e04b6d6a14b 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud