Explorar el Código

[mips] Revert r309942 & r309940

This reverts commit r309942 & commit r309940.

A revert was requested following post commit review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309978 91177308-0d34-0410-b5e6-96231b3b80d8
Simon Dardis hace 8 años
padre
commit
cd890be4bd

+ 0 - 8
include/clang/Driver/Options.td

@@ -2057,14 +2057,6 @@ def membedded_data : Flag<["-"], "membedded-data">, Group<m_Group>,
 def mno_embedded_data : Flag<["-"], "mno-embedded-data">, Group<m_Group>,
 def mno_embedded_data : Flag<["-"], "mno-embedded-data">, Group<m_Group>,
   HelpText<"Do not place constants in the .rodata section instead of the "
   HelpText<"Do not place constants in the .rodata section instead of the "
            ".sdata if they meet the -G <size> threshold (MIPS)">;
            ".sdata if they meet the -G <size> threshold (MIPS)">;
-def muninit_const_in_rodata : Flag<["-"], "muninit-const-in-rodata">,
-  Group<m_Group>, Flags<[DriverOption,CC1Option]>, HelpText<"Place "
-  "uninitialized constants in the read-only data section instead of"
-  " the common section (MIPS)">;
-def mno_uninit_const_in_rodata : Flag<["-"], "mno-uninit-const-in-rodata">,
-  Group<m_Group>, HelpText<"Do not place uninitialized constants in the "
-                           "read-only data section instead of the common"
-                           " section (MIPS)">;
 def mnan_EQ : Joined<["-"], "mnan=">, Group<m_Group>;
 def mnan_EQ : Joined<["-"], "mnan=">, Group<m_Group>;
 def mabicalls : Flag<["-"], "mabicalls">, Group<m_Group>,
 def mabicalls : Flag<["-"], "mabicalls">, Group<m_Group>,
   HelpText<"Enable SVR4-style position-independent code (Mips only)">;
   HelpText<"Enable SVR4-style position-independent code (Mips only)">;

+ 0 - 2
include/clang/Frontend/CodeGenOptions.def

@@ -101,8 +101,6 @@ CODEGENOPT(MergeAllConstants , 1, 1) ///< Merge identical constants.
 CODEGENOPT(MergeFunctions    , 1, 0) ///< Set when -fmerge-functions is enabled.
 CODEGENOPT(MergeFunctions    , 1, 0) ///< Set when -fmerge-functions is enabled.
 CODEGENOPT(MSVolatile        , 1, 0) ///< Set when /volatile:ms is enabled.
 CODEGENOPT(MSVolatile        , 1, 0) ///< Set when /volatile:ms is enabled.
 CODEGENOPT(NoCommon          , 1, 0) ///< Set when -fno-common or C++ is enabled.
 CODEGENOPT(NoCommon          , 1, 0) ///< Set when -fno-common or C++ is enabled.
-CODEGENOPT(UInitCstDataInROData, 1, 0) ///< Set when -mgpopt & -membedded-data
-                                       ///< & -muinit-const-in-rodata is set
 CODEGENOPT(NoDwarfDirectoryAsm , 1, 0) ///< Set when -fno-dwarf-directory-asm is
 CODEGENOPT(NoDwarfDirectoryAsm , 1, 0) ///< Set when -fno-dwarf-directory-asm is
                                        ///< enabled.
                                        ///< enabled.
 CODEGENOPT(NoExecStack       , 1, 0) ///< Set when -Wa,--noexecstack is enabled.
 CODEGENOPT(NoExecStack       , 1, 0) ///< Set when -Wa,--noexecstack is enabled.

+ 0 - 14
lib/CodeGen/TargetInfo.cpp

@@ -6656,20 +6656,6 @@ public:
   void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV,
   void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV,
                            CodeGen::CodeGenModule &CGM,
                            CodeGen::CodeGenModule &CGM,
                            ForDefinition_t IsForDefinition) const override {
                            ForDefinition_t IsForDefinition) const override {
-
-    if (const VarDecl *VD = dyn_cast_or_null<VarDecl>(D)) {
-      if (CGM.getCodeGenOpts().UInitCstDataInROData &&
-          VD->getType().isConstQualified() && !VD->hasInit()) {
-        llvm::GlobalVariable *GVar = dyn_cast_or_null<llvm::GlobalVariable>(GV);
-        if (GVar && !GVar->hasSection()) {
-          GVar->setLinkage(llvm::GlobalValue::ExternalLinkage);
-          GVar->setSection("rodata");
-        }
-      }
-
-      return;
-    }
-
     const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D);
     const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D);
     if (!FD) return;
     if (!FD) return;
     llvm::Function *Fn = cast<llvm::Function>(GV);
     llvm::Function *Fn = cast<llvm::Function>(GV);

+ 0 - 8
lib/Driver/ToolChains/Clang.cpp

@@ -1515,14 +1515,6 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args,
         CmdArgs.push_back("-membedded-data=0");
         CmdArgs.push_back("-membedded-data=0");
       }
       }
       EmbeddedData->claim();
       EmbeddedData->claim();
-
-      if (Arg *A = Args.getLastArg(options::OPT_muninit_const_in_rodata,
-                                   options::OPT_mno_uninit_const_in_rodata)) {
-        if (A->getOption().matches(options::OPT_muninit_const_in_rodata)) {
-          CmdArgs.push_back("-muninit-const-in-rodata");
-          A->claim();
-        }
-      }
     }
     }
 
 
   } else if ((!ABICalls || (!NoABICalls && ABICalls)) && WantGPOpt)
   } else if ((!ABICalls || (!NoABICalls && ABICalls)) && WantGPOpt)

+ 0 - 2
lib/Frontend/CompilerInvocation.cpp

@@ -950,8 +950,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
 
 
   Opts.Backchain = Args.hasArg(OPT_mbackchain);
   Opts.Backchain = Args.hasArg(OPT_mbackchain);
 
 
-  Opts.UInitCstDataInROData = Args.hasArg(OPT_muninit_const_in_rodata);
-
   Opts.EmitCheckPathComponentsToStrip = getLastArgIntValue(
   Opts.EmitCheckPathComponentsToStrip = getLastArgIntValue(
       Args, OPT_fsanitize_undefined_strip_path_components_EQ, 0, Diags);
       Args, OPT_fsanitize_undefined_strip_path_components_EQ, 0, Diags);
 
 

+ 0 - 12
test/CodeGen/mips-uninit-const-in-ro.c

@@ -1,12 +0,0 @@
-// RUN: %clang_cc1 -triple mips-mti--elf -emit-llvm -mrelocation-model static \
-// RUN:            -target-feature +noabicalls -mllvm -mgpopt -mllvm \
-// RUN:            -membedded-data=1 -muninit-const-in-rodata -o - %s | \
-// RUN:   FileCheck %s
-
-// REQUIRES: mips-registered-target
-
-// Test that -muninit-const-in-rodata places constant uninitialized structures
-// in the .rodata section rather than the commeon section.
-
-// CHECK: @a = global [8 x i32] zeroinitializer, section "rodata", align 4
-const int a[8];