[llvm-commits] CVS: llvm/include/llvm/Function.h GlobalValue.h GlobalVariable.h
Chris Lattner
lattner at cs.uiuc.edu
Wed Oct 9 18:12:01 PDT 2002
Changes in directory llvm/include/llvm:
Function.h updated: 1.36 -> 1.37
GlobalValue.h updated: 1.7 -> 1.8
GlobalVariable.h updated: 1.16 -> 1.17
---
Log message:
Make isExtern() be a virtual function inherited from GlobalValue
---
Diffs of the changes:
Index: llvm/include/llvm/Function.h
diff -u llvm/include/llvm/Function.h:1.36 llvm/include/llvm/Function.h:1.37
--- llvm/include/llvm/Function.h:1.36 Fri Sep 6 16:31:57 2002
+++ llvm/include/llvm/Function.h Wed Oct 9 18:11:32 2002
@@ -85,7 +85,7 @@
/// is empty if so) this is true for external functions, defined as forward
/// "declare"ations
///
- bool isExternal() const { return BasicBlocks.empty(); }
+ virtual bool isExternal() const { return BasicBlocks.empty(); }
// getNext/Prev - Return the next or previous function in the list. These
// methods should never be used directly, and are only used to implement the
Index: llvm/include/llvm/GlobalValue.h
diff -u llvm/include/llvm/GlobalValue.h:1.7 llvm/include/llvm/GlobalValue.h:1.8
--- llvm/include/llvm/GlobalValue.h:1.7 Fri Sep 6 16:31:57 2002
+++ llvm/include/llvm/GlobalValue.h Wed Oct 9 18:11:33 2002
@@ -26,17 +26,22 @@
public:
~GlobalValue() {}
- // getType - Global values are always pointers.
+ /// getType - Global values are always pointers.
inline const PointerType *getType() const {
return (const PointerType*)User::getType();
}
- // Internal Linkage - True if the global value is inaccessible to
+ /// Internal Linkage - True if the global value is inaccessible to
bool hasInternalLinkage() const { return HasInternalLinkage; }
bool hasExternalLinkage() const { return !HasInternalLinkage; }
void setInternalLinkage(bool HIL) { HasInternalLinkage = HIL; }
- // Get the module that this global value is contained inside of...
+ /// isExternal - Return true if the primary definition of this global value is
+ /// outside of the current translation unit...
+ virtual bool isExternal() const = 0;
+
+ /// getParent - Get the module that this global value is contained inside
+ /// of...
inline Module *getParent() { return Parent; }
inline const Module *getParent() const { return Parent; }
Index: llvm/include/llvm/GlobalVariable.h
diff -u llvm/include/llvm/GlobalVariable.h:1.16 llvm/include/llvm/GlobalVariable.h:1.17
--- llvm/include/llvm/GlobalVariable.h:1.16 Sun Oct 6 17:29:58 2002
+++ llvm/include/llvm/GlobalVariable.h Wed Oct 9 18:11:33 2002
@@ -46,7 +46,7 @@
/// global variable is defined in some other translation unit, and is thus
/// externally defined here.
///
- bool isExternal() const { return Operands.empty(); }
+ virtual bool isExternal() const { return Operands.empty(); }
/// hasInitializer - Unless a global variable isExternal(), it has an
/// initializer. The initializer for the global variable/constant is held by
More information about the llvm-commits
mailing list