[llvm] r212960 - Remove GCC 3.3 workaround

Matt Arsenault Matthew.Arsenault at amd.com
Mon Jul 14 10:11:20 PDT 2014


Author: arsenm
Date: Mon Jul 14 12:11:20 2014
New Revision: 212960

URL: http://llvm.org/viewvc/llvm-project?rev=212960&view=rev
Log:
Remove GCC 3.3 workaround

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineFunction.h

Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=212960&r1=212959&r2=212960&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Mon Jul 14 12:11:20 2014
@@ -227,19 +227,14 @@ public:
   void setHasInlineAsm(bool B) {
     HasInlineAsm = B;
   }
-  
+
   /// getInfo - Keep track of various per-function pieces of information for
   /// backends that would like to do so.
   ///
   template<typename Ty>
   Ty *getInfo() {
-    if (!MFInfo) {
-        // This should be just `new (Allocator.Allocate<Ty>()) Ty(*this)', but
-        // that apparently breaks GCC 3.3.
-        Ty *Loc = static_cast<Ty*>(Allocator.Allocate(sizeof(Ty),
-                                                      AlignOf<Ty>::Alignment));
-        MFInfo = new (Loc) Ty(*this);
-    }
+    if (!MFInfo)
+      MFInfo = new (Allocator.Allocate<Ty>()) Ty(*this);
     return static_cast<Ty*>(MFInfo);
   }
 





More information about the llvm-commits mailing list