[cfe-commits] r135775 - in /cfe/trunk/lib: Frontend/ASTUnit.cpp Serialization/ASTReader.cpp

Jordy Rose jediknil at belkadan.com
Fri Jul 22 11:13:37 PDT 2011


...and now that we're not modifying the module name at all, do we still need the string-copy into ModName? It looks like we could just pass PreambleFile directly to TranslateStoredDiagnostics.

Jordy


On Jul 22, 2011, at 10:25, Jonathan D. Turner wrote:

> Author: jonturner
> Date: Fri Jul 22 12:25:03 2011
> New Revision: 135775
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=135775&view=rev
> Log:
> Remove prepending of '$' to module names.
> 
> 
> Modified:
>    cfe/trunk/lib/Frontend/ASTUnit.cpp
>    cfe/trunk/lib/Serialization/ASTReader.cpp
> 
> Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=135775&r1=135774&r2=135775&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
> +++ cfe/trunk/lib/Frontend/ASTUnit.cpp Fri Jul 22 12:25:03 2011
> @@ -980,7 +980,7 @@
>     goto error;
> 
>   if (OverrideMainBuffer) {
> -    std::string ModName = "$" + PreambleFile;
> +    std::string ModName = PreambleFile;
>     TranslateStoredDiagnostics(Clang->getModuleManager(), ModName,
>                                getSourceManager(), PreambleDiagnostics,
>                                StoredDiagnostics);
> @@ -2293,7 +2293,7 @@
>   if (Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0].second,
>                            Clang->getFrontendOpts().Inputs[0].first)) {
>     if (OverrideMainBuffer) {
> -      std::string ModName = "$" + PreambleFile;
> +      std::string ModName = PreambleFile;
>       TranslateStoredDiagnostics(Clang->getModuleManager(), ModName,
>                                  getSourceManager(), PreambleDiagnostics,
>                                  StoredDiagnostics);
> 
> Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=135775&r1=135774&r2=135775&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
> +++ cfe/trunk/lib/Serialization/ASTReader.cpp Fri Jul 22 12:25:03 2011
> @@ -2643,8 +2643,8 @@
>   else
>     FirstInSource = &F;
>   F.Loaders.push_back(Prev);
> -  // A non-module AST file's module name is $filename.
> -  Modules["$" + FileName.str()] = &F;
> +
> +  Modules[FileName.str()] = &F;
> 
>   // Set the AST file name.
>   F.FileName = FileName;
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list