[llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp
Anton Korobeynikov
asl at math.spbu.ru
Thu Nov 30 16:25:35 PST 2006
Changes in directory llvm/lib/VMCore:
ConstantFolding.cpp updated: 1.100 -> 1.101
---
Log message:
Introducing external weak linkage. Darwin codegen should be added later.
---
Diffs of the changes: (+2 -5)
ConstantFolding.cpp | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
Index: llvm/lib/VMCore/ConstantFolding.cpp
diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.100 llvm/lib/VMCore/ConstantFolding.cpp:1.101
--- llvm/lib/VMCore/ConstantFolding.cpp:1.100 Sun Nov 26 19:05:10 2006
+++ llvm/lib/VMCore/ConstantFolding.cpp Thu Nov 30 18:25:12 2006
@@ -894,11 +894,8 @@
case Instruction::PtrToInt:
// Cast of a global address to boolean is always true.
- if (isa<GlobalValue>(V)) {
- if (DestTy == Type::BoolTy)
- // FIXME: When we support 'external weak' references, we have to
- // prevent this transformation from happening. This code will need
- // to be updated to ignore external weak symbols when we support it.
+ if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
+ if (DestTy == Type::BoolTy && !GV->hasExternalWeakLinkage())
return ConstantBool::getTrue();
}
break;
More information about the llvm-commits
mailing list