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/CodeGen/MachineModuleInfo.cpp | |
parent | d68c04f16238158c7ea89cf72a3da49b103fa6d9 (diff) | |
download | llvm-da3db11db30ae459a5bd25dd71eb1ec902c8164a.zip llvm-da3db11db30ae459a5bd25dd71eb1ec902c8164a.tar.gz llvm-da3db11db30ae459a5bd25dd71eb1ec902c8164a.tar.bz2 |
- 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/CodeGen/MachineModuleInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index 123ad6d..52737a6 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -10,6 +10,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/Constants.h" +#include "llvm/Analysis/ValueTracking.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineLocation.h" @@ -206,7 +207,9 @@ public: } virtual void Apply(std::string &Field) { Constant *C = CI->getOperand(I++); - Field = C->getStringValue(); + // Fills in the string if it succeeds + if (!GetConstantStringInfo(C, Field)) + Field.clear(); } virtual void Apply(DebugInfoDesc *&Field) { Constant *C = CI->getOperand(I++); |