[cfe-dev] [PATCH] Refactoring: fix making absolute FilePath in Replacement

Justin Bogner mail at justinbogner.com
Mon Sep 1 15:07:41 PDT 2014


Steffen Prohaska <prohaska at zib.de> writes:
> An std::error_code of 0 indicates success.  The condition must be reversed.
>
> See diff below for http://llvm.org/svn/llvm-project/cfe/trunk
>
> ---
>
> Hello,
> I'm unsure whether this is the right way to submit a patch.  Please let me
> know if I should prepare it in a different way.

Generally, we prefer patches to be sent to cfe-commits@, rather than
cfe-dev@, for future reference.

Additionally, we usually like to check in a test with bug fixes. This is
pretty obvious by inspection, but if you have a case where it fails and
can easily be reduced, submitting that as well would be appreciated.

> Best,
>   Steffen
>
>
> Index: lib/Tooling/Refactoring.cpp
> ===================================================================
> --- lib/Tooling/Refactoring.cpp	(revision 216889)
> +++ lib/Tooling/Refactoring.cpp	(working copy)
> @@ -111,7 +111,7 @@
>      // relative paths for files are used.
>      llvm::SmallString<256> FilePath(Entry->getName());
>      std::error_code EC = llvm::sys::fs::make_absolute(FilePath);
> -    this->FilePath = EC ? FilePath.c_str() : Entry->getName();
> +    this->FilePath = (!EC) ? FilePath.c_str() : Entry->getName();
>    } else {
>      this->FilePath = InvalidLocation;
>    }
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list