[llvm-commits] [gcc-plugin] r75338 - /gcc-plugin/trunk/llvm-convert.cpp
Duncan Sands
baldrick at free.fr
Fri Jul 10 20:45:48 PDT 2009
Author: baldrick
Date: Fri Jul 10 22:45:48 2009
New Revision: 75338
URL: http://llvm.org/viewvc/llvm-project?rev=75338&view=rev
Log:
GCC mainline does not support writable strings.
Modified:
gcc-plugin/trunk/llvm-convert.cpp
Modified: gcc-plugin/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-convert.cpp?rev=75338&r1=75337&r2=75338&view=diff
==============================================================================
--- gcc-plugin/trunk/llvm-convert.cpp (original)
+++ gcc-plugin/trunk/llvm-convert.cpp Fri Jul 10 22:45:48 2009
@@ -7786,20 +7786,15 @@
Constant *TreeConstantToLLVM::EmitLV_STRING_CST(tree exp) {
Constant *Init = TreeConstantToLLVM::ConvertSTRING_CST(exp);
- // Support -fwritable-strings.
- bool StringIsConstant = !flag_writable_strings;
-
GlobalVariable **SlotP = 0;
- if (StringIsConstant) {
- // Cache the string constants to avoid making obvious duplicate strings that
- // have to be folded by the optimizer.
- static std::map<Constant*, GlobalVariable*> StringCSTCache;
- GlobalVariable *&Slot = StringCSTCache[Init];
- if (Slot) return Slot;
- SlotP = &Slot;
- }
-
+ // Cache the string constants to avoid making obvious duplicate strings that
+ // have to be folded by the optimizer.
+ static std::map<Constant*, GlobalVariable*> StringCSTCache;
+ GlobalVariable *&Slot = StringCSTCache[Init];
+ if (Slot) return Slot;
+ SlotP = &Slot;
+
// Create a new string global.
const TargetAsmInfo *TAI = TheTarget->getTargetAsmInfo();
GlobalVariable *GV = new GlobalVariable(*TheModule, Init->getType(),
More information about the llvm-commits
mailing list