From 70968319719fbfb00a58ebcf82b1e18ec04be5be Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 19 Jul 2013 18:44:51 +0000 Subject: [PATCH] s/compiler_used/compiler.used/. We were incorrectly using compiler_used instead of compiler.used. Unfortunately the passes using the broken name had tests also using the broken name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186705 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Verifier.cpp | 2 +- lib/Transforms/IPO/GlobalOpt.cpp | 14 +++++++------- test/CodeGen/X86/compiler_used.ll | 2 +- test/Transforms/GlobalOpt/alias-used.ll | 4 ++-- test/Verifier/llvm.compiler_used-invalid-type.ll | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index 6a7f45f6287..1d495b7ed46 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -460,7 +460,7 @@ void Verifier::visitGlobalVariable(GlobalVariable &GV) { } if (GV.hasName() && (GV.getName() == "llvm.used" || - GV.getName() == "llvm.compiler_used")) { + GV.getName() == "llvm.compiler.used")) { Assert1(!GV.hasInitializer() || GV.hasAppendingLinkage(), "invalid linkage for intrinsic global variable", &GV); Type *GVType = GV.getType()->getElementType(); diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index f0b35c63973..669162cb3d8 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -3040,7 +3040,7 @@ bool GlobalOpt::OptimizeGlobalCtorsList(GlobalVariable *&GCL) { return true; } -/// \brief Given "llvm.used" or "llvm.compiler_used" as a global name, collect +/// \brief Given "llvm.used" or "llvm.compiler.used" as a global name, collect /// the initializer elements of that global in Set and return the global itself. static GlobalVariable * collectUsedGlobalVariables(const Module &M, const char *Name, @@ -3093,7 +3093,7 @@ static void setUsedInitializer(GlobalVariable &V, } namespace { -/// \brief An easy to access representation of llvm.used and llvm.compiler_used. +/// \brief An easy to access representation of llvm.used and llvm.compiler.used. class LLVMUsed { SmallPtrSet Used; SmallPtrSet CompilerUsed; @@ -3104,7 +3104,7 @@ public: LLVMUsed(const Module &M) { UsedV = collectUsedGlobalVariables(M, "llvm.used", Used); CompilerUsedV = - collectUsedGlobalVariables(M, "llvm.compiler_used", CompilerUsed); + collectUsedGlobalVariables(M, "llvm.compiler.used", CompilerUsed); } typedef SmallPtrSet::iterator iterator; iterator usedBegin() { return Used.begin(); } @@ -3135,13 +3135,13 @@ static bool hasUseOtherThanLLVMUsed(GlobalAlias &GA, const LLVMUsed &U) { assert((!U.usedCount(&GA) || !U.compilerUsedCount(&GA)) && "We should have removed the duplicated " - "element from llvm.compiler_used"); + "element from llvm.compiler.used"); if (!GA.hasOneUse()) // Strictly more than one use. So at least one is not in llvm.used and - // llvm.compiler_used. + // llvm.compiler.used. return true; - // Exactly one use. Check if it is in llvm.used or llvm.compiler_used. + // Exactly one use. Check if it is in llvm.used or llvm.compiler.used. return !U.usedCount(&GA) && !U.compilerUsedCount(&GA); } @@ -3150,7 +3150,7 @@ static bool hasMoreThanOneUseOtherThanLLVMUsed(GlobalValue &V, unsigned N = 2; assert((!U.usedCount(&V) || !U.compilerUsedCount(&V)) && "We should have removed the duplicated " - "element from llvm.compiler_used"); + "element from llvm.compiler.used"); if (U.usedCount(&V) || U.compilerUsedCount(&V)) ++N; return V.hasNUsesOrMore(N); diff --git a/test/CodeGen/X86/compiler_used.ll b/test/CodeGen/X86/compiler_used.ll index d38ce91310b..af5c86c451a 100644 --- a/test/CodeGen/X86/compiler_used.ll +++ b/test/CodeGen/X86/compiler_used.ll @@ -5,7 +5,7 @@ @Z = internal global i8 4 @llvm.used = appending global [1 x i8*] [ i8* @Z ], section "llvm.metadata" -@llvm.compiler_used = appending global [2 x i8*] [ i8* @X, i8* bitcast (i32* @Y to i8*)], section "llvm.metadata" +@llvm.compiler.used = appending global [2 x i8*] [ i8* @X, i8* bitcast (i32* @Y to i8*)], section "llvm.metadata" ; CHECK-NOT: .no_dead_strip ; CHECK: .no_dead_strip _Z diff --git a/test/Transforms/GlobalOpt/alias-used.ll b/test/Transforms/GlobalOpt/alias-used.ll index 758e469b3c8..05ac7f9bddb 100644 --- a/test/Transforms/GlobalOpt/alias-used.ll +++ b/test/Transforms/GlobalOpt/alias-used.ll @@ -9,8 +9,8 @@ @llvm.used = appending global [3 x i8*] [i8* bitcast (void ()* @fa to i8*), i8* bitcast (void ()* @f to i8*), i8* @ca], section "llvm.metadata" ; CHECK-DAG: @llvm.used = appending global [3 x i8*] [i8* bitcast (void ()* @fa to i8*), i8* bitcast (void ()* @f to i8*), i8* @ca], section "llvm.metadata" -@llvm.compiler_used = appending global [4 x i8*] [i8* bitcast (void ()* @fa3 to i8*), i8* bitcast (void ()* @fa to i8*), i8* @ia, i8* @i], section "llvm.metadata" -; CHECK-DAG: @llvm.compiler_used = appending global [2 x i8*] [i8* bitcast (void ()* @fa3 to i8*), i8* @ia], section "llvm.metadata" +@llvm.compiler.used = appending global [4 x i8*] [i8* bitcast (void ()* @fa3 to i8*), i8* bitcast (void ()* @fa to i8*), i8* @ia, i8* @i], section "llvm.metadata" +; CHECK-DAG: @llvm.compiler.used = appending global [2 x i8*] [i8* bitcast (void ()* @fa3 to i8*), i8* @ia], section "llvm.metadata" @sameAsUsed = global [3 x i8*] [i8* bitcast (void ()* @fa to i8*), i8* bitcast (void ()* @f to i8*), i8* @ca] ; CHECK-DAG: @sameAsUsed = global [3 x i8*] [i8* bitcast (void ()* @f to i8*), i8* bitcast (void ()* @f to i8*), i8* @c] diff --git a/test/Verifier/llvm.compiler_used-invalid-type.ll b/test/Verifier/llvm.compiler_used-invalid-type.ll index 0913027fb47..ef533b5bf78 100644 --- a/test/Verifier/llvm.compiler_used-invalid-type.ll +++ b/test/Verifier/llvm.compiler_used-invalid-type.ll @@ -1,6 +1,6 @@ ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s -@llvm.compiler_used = appending global [1 x i32] [i32 0], section "llvm.metadata" +@llvm.compiler.used = appending global [1 x i32] [i32 0], section "llvm.metadata" ; CHECK: wrong type for intrinsic global variable -; CHECK-NEXT: [1 x i32]* @llvm.compiler_used +; CHECK-NEXT: [1 x i32]* @llvm.compiler.used