Add 'const' qualifiers to static const char* variables.

llvm-svn: 186371
This commit is contained in:
Craig Topper 2013-07-16 01:17:10 +00:00
parent e07303b68d
commit b8260534f6
9 changed files with 38 additions and 37 deletions

View File

@ -51,7 +51,7 @@ INITIALIZE_PASS_DEPENDENCY(DominatorTree)
INITIALIZE_PASS_END(LoopInfo, "loops", "Natural Loop Information", true, true) INITIALIZE_PASS_END(LoopInfo, "loops", "Natural Loop Information", true, true)
// Loop identifier metadata name. // Loop identifier metadata name.
static const char* LoopMDName = "llvm.loop"; static const char *const LoopMDName = "llvm.loop";
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Loop implementation // Loop implementation

View File

@ -50,9 +50,9 @@
#include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm; using namespace llvm;
static const char *DWARFGroupName = "DWARF Emission"; static const char *const DWARFGroupName = "DWARF Emission";
static const char *DbgTimerName = "DWARF Debug Writer"; static const char *const DbgTimerName = "DWARF Debug Writer";
static const char *EHTimerName = "DWARF Exception Writer"; static const char *const EHTimerName = "DWARF Exception Writer";
STATISTIC(EmittedInsts, "Number of machine instrs printed"); STATISTIC(EmittedInsts, "Number of machine instrs printed");

View File

@ -92,8 +92,8 @@ static cl::opt<DefaultOnOff> SplitDwarf("split-dwarf", cl::Hidden,
cl::init(Default)); cl::init(Default));
namespace { namespace {
const char *DWARFGroupName = "DWARF Emission"; const char *const DWARFGroupName = "DWARF Emission";
const char *DbgTimerName = "DWARF Debug Writer"; const char *const DbgTimerName = "DWARF Debug Writer";
struct CompareFirst { struct CompareFirst {
template <typename T> bool operator()(const T &lhs, const T &rhs) const { template <typename T> bool operator()(const T &lhs, const T &rhs) const {

View File

@ -22,8 +22,8 @@ namespace llvm {
extern bool TimePassesIsEnabled; extern bool TimePassesIsEnabled;
} }
static const char *TimeIRParsingGroupName = "LLVM IR Parsing"; static const char *const TimeIRParsingGroupName = "LLVM IR Parsing";
static const char *TimeIRParsingName = "Parse IR"; static const char *const TimeIRParsingName = "Parse IR";
Module *llvm::getLazyIRModule(MemoryBuffer *Buffer, SMDiagnostic &Err, Module *llvm::getLazyIRModule(MemoryBuffer *Buffer, SMDiagnostic &Err,

View File

@ -242,7 +242,7 @@ void MCObjectStreamer::EmitInstToFragment(const MCInst &Inst) {
} }
#ifndef NDEBUG #ifndef NDEBUG
static const char *BundlingNotImplementedMsg = static const char *const BundlingNotImplementedMsg =
"Aligned bundling is not implemented for this object format"; "Aligned bundling is not implemented for this object format";
#endif #endif

View File

@ -21,7 +21,7 @@
using namespace llvm; using namespace llvm;
using namespace object; using namespace object;
static const char *Magic = "!<arch>\n"; static const char *const Magic = "!<arch>\n";
void Archive::anchor() { } void Archive::anchor() { }

View File

@ -31,13 +31,13 @@ typedef std::pair<BasicBlock *, Value *> StackEntry;
typedef SmallVector<StackEntry, 16> StackVector; typedef SmallVector<StackEntry, 16> StackVector;
// Intrinsic names the control flow is annotated with // Intrinsic names the control flow is annotated with
static const char *IfIntrinsic = "llvm.SI.if"; static const char *const IfIntrinsic = "llvm.SI.if";
static const char *ElseIntrinsic = "llvm.SI.else"; static const char *const ElseIntrinsic = "llvm.SI.else";
static const char *BreakIntrinsic = "llvm.SI.break"; static const char *const BreakIntrinsic = "llvm.SI.break";
static const char *IfBreakIntrinsic = "llvm.SI.if.break"; static const char *const IfBreakIntrinsic = "llvm.SI.if.break";
static const char *ElseBreakIntrinsic = "llvm.SI.else.break"; static const char *const ElseBreakIntrinsic = "llvm.SI.else.break";
static const char *LoopIntrinsic = "llvm.SI.loop"; static const char *const LoopIntrinsic = "llvm.SI.loop";
static const char *EndCfIntrinsic = "llvm.SI.end.cf"; static const char *const EndCfIntrinsic = "llvm.SI.end.cf";
class SIAnnotateControlFlow : public FunctionPass { class SIAnnotateControlFlow : public FunctionPass {

View File

@ -63,25 +63,26 @@ static const size_t kMaxStackMallocSize = 1 << 16; // 64K
static const uintptr_t kCurrentStackFrameMagic = 0x41B58AB3; static const uintptr_t kCurrentStackFrameMagic = 0x41B58AB3;
static const uintptr_t kRetiredStackFrameMagic = 0x45E0360E; static const uintptr_t kRetiredStackFrameMagic = 0x45E0360E;
static const char *kAsanModuleCtorName = "asan.module_ctor"; static const char *const kAsanModuleCtorName = "asan.module_ctor";
static const char *kAsanModuleDtorName = "asan.module_dtor"; static const char *const kAsanModuleDtorName = "asan.module_dtor";
static const int kAsanCtorAndCtorPriority = 1; static const int kAsanCtorAndCtorPriority = 1;
static const char *kAsanReportErrorTemplate = "__asan_report_"; static const char *const kAsanReportErrorTemplate = "__asan_report_";
static const char *kAsanReportLoadN = "__asan_report_load_n"; static const char *const kAsanReportLoadN = "__asan_report_load_n";
static const char *kAsanReportStoreN = "__asan_report_store_n"; static const char *const kAsanReportStoreN = "__asan_report_store_n";
static const char *kAsanRegisterGlobalsName = "__asan_register_globals"; static const char *const kAsanRegisterGlobalsName = "__asan_register_globals";
static const char *kAsanUnregisterGlobalsName = "__asan_unregister_globals"; static const char *const kAsanUnregisterGlobalsName = "__asan_unregister_globals";
static const char *kAsanPoisonGlobalsName = "__asan_before_dynamic_init"; static const char *const kAsanPoisonGlobalsName = "__asan_before_dynamic_init";
static const char *kAsanUnpoisonGlobalsName = "__asan_after_dynamic_init"; static const char *const kAsanUnpoisonGlobalsName = "__asan_after_dynamic_init";
static const char *kAsanInitName = "__asan_init_v3"; static const char *const kAsanInitName = "__asan_init_v3";
static const char *kAsanHandleNoReturnName = "__asan_handle_no_return"; static const char *const kAsanHandleNoReturnName = "__asan_handle_no_return";
static const char *kAsanMappingOffsetName = "__asan_mapping_offset"; static const char *const kAsanMappingOffsetName = "__asan_mapping_offset";
static const char *kAsanMappingScaleName = "__asan_mapping_scale"; static const char *const kAsanMappingScaleName = "__asan_mapping_scale";
static const char *kAsanStackMallocName = "__asan_stack_malloc"; static const char *const kAsanStackMallocName = "__asan_stack_malloc";
static const char *kAsanStackFreeName = "__asan_stack_free"; static const char *const kAsanStackFreeName = "__asan_stack_free";
static const char *kAsanGenPrefix = "__asan_gen_"; static const char *const kAsanGenPrefix = "__asan_gen_";
static const char *kAsanPoisonStackMemoryName = "__asan_poison_stack_memory"; static const char *const kAsanPoisonStackMemoryName =
static const char *kAsanUnpoisonStackMemoryName = "__asan_poison_stack_memory";
static const char *const kAsanUnpoisonStackMemoryName =
"__asan_unpoison_stack_memory"; "__asan_unpoison_stack_memory";
static const int kAsanStackLeftRedzoneMagic = 0xf1; static const int kAsanStackLeftRedzoneMagic = 0xf1;

View File

@ -45,7 +45,7 @@ typedef DenseMap<BasicBlock *, BasicBlock*> BB2BBMap;
// The name for newly created blocks. // The name for newly created blocks.
static const char *FlowBlockName = "Flow"; static const char *const FlowBlockName = "Flow";
/// @brief Find the nearest common dominator for multiple BasicBlocks /// @brief Find the nearest common dominator for multiple BasicBlocks
/// ///