diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-06-30 07:31:25 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-06-30 07:31:25 +0000 |
commit | da3db11db30ae459a5bd25dd71eb1ec902c8164a (patch) | |
tree | ff5fbb67881d32866669572601431e1778b8d856 /llvm/lib/VMCore/IntrinsicInst.cpp | |
parent | d68c04f16238158c7ea89cf72a3da49b103fa6d9 (diff) | |
download | bcm5719-llvm-da3db11db30ae459a5bd25dd71eb1ec902c8164a.tar.gz bcm5719-llvm-da3db11db30ae459a5bd25dd71eb1ec902c8164a.zip |
- Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag.
- Correctly handle memcpy from constant string which is zero-initialized.
llvm-svn: 52891
Diffstat (limited to 'llvm/lib/VMCore/IntrinsicInst.cpp')
-rw-r--r-- | llvm/lib/VMCore/IntrinsicInst.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/VMCore/IntrinsicInst.cpp b/llvm/lib/VMCore/IntrinsicInst.cpp index eca606292dc..6bd9431767e 100644 --- a/llvm/lib/VMCore/IntrinsicInst.cpp +++ b/llvm/lib/VMCore/IntrinsicInst.cpp @@ -28,6 +28,7 @@ #include "llvm/IntrinsicInst.h" #include "llvm/Constants.h" #include "llvm/GlobalVariable.h" +#include "llvm/Analysis/ValueTracking.h" #include "llvm/CodeGen/MachineDebugInfoDesc.h" #include "llvm/CodeGen/MachineModuleInfo.h" using namespace llvm; @@ -58,20 +59,20 @@ Value *DbgInfoIntrinsic::StripCast(Value *C) { /// DbgStopPointInst - This represents the llvm.dbg.stoppoint instruction. /// -std::string DbgStopPointInst::getFileName() const { +Value *DbgStopPointInst::getFileName() const { // Once the operand indices are verified, update this assert assert(LLVMDebugVersion == (6 << 16) && "Verify operand indices"); GlobalVariable *GV = cast<GlobalVariable>(getContext()); - if (!GV->hasInitializer()) return ""; + if (!GV->hasInitializer()) return NULL; ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer()); - return CS->getOperand(3)->getStringValue(); + return CS->getOperand(4); } -std::string DbgStopPointInst::getDirectory() const { +Value *DbgStopPointInst::getDirectory() const { // Once the operand indices are verified, update this assert assert(LLVMDebugVersion == (6 << 16) && "Verify operand indices"); GlobalVariable *GV = cast<GlobalVariable>(getContext()); - if (!GV->hasInitializer()) return ""; + if (!GV->hasInitializer()) return NULL; ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer()); - return CS->getOperand(4)->getStringValue(); + return CS->getOperand(4); } |