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

Reid Kleckner rnk at google.com
Tue Jul 16 06:22:33 PDT 2013


Isn't it better to write these as arrays instead of pointers, if you want
to micro-optimize the .rodata size and reduce relocations?
http://glandium.org/blog/?p=2361


On Tue, Jul 16, 2013 at 1:03 AM, Craig Topper <craig.topper at gmail.com>wrote:

> Author: ctopper
> Date: Tue Jul 16 00:03:10 2013
> New Revision: 186383
>
> URL: http://llvm.org/viewvc/llvm-project?rev=186383&view=rev
> Log:
> Add 'const' qualifiers to static const char* variables.
>
> Modified:
>     cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
>
> Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=186383&r1=186382&r2=186383&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
> +++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Tue Jul 16 00:03:10
> 2013
> @@ -1592,8 +1592,8 @@ static const Stmt *getTerminatorConditio
>    return S;
>  }
>
> -static const char *StrEnteringLoop = "Entering loop body";
> -static const char *StrLoopBodyZero = "Loop body executed 0 times";
> +static const char *const StrEnteringLoop = "Entering loop body";
> +static const char *const StrLoopBodyZero = "Loop body executed 0 times";
>
>  static bool
>  GenerateAlternateExtensivePathDiagnostic(PathDiagnostic& PD,
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130716/a3c75005/attachment.html>


More information about the cfe-commits mailing list