================
Comment at: lib/Tooling/Refactoring.cpp:108
@@ -107,4 +107,3 @@
   const FileEntry *Entry = Sources.getFileEntryForID(DecomposedLocation.first);
-
-  if (Entry != NULL) {
+  if (Entry != NULL)
     // Make FilePath absolute so replacements can be applied correctly when
----------------
I'd always use {} if there's a more complex statement inside.

================
Comment at: lib/Tooling/Refactoring.cpp:112
@@ +111,3 @@
+    // files.
+    if (Sources.getFileManager().isFileVirtual(Entry->getName())) {
+      this->FilePath = Entry->getName();
----------------
Can't we instead just check whether the relative file exists?
If the file is relative, and it can be accessed via the filesystem, use 
make_absolute; otherwise, simply use the entry name.

================
Comment at: include/clang/Basic/FileManager.h:278
@@ +277,3 @@
+  /// \brief Check if a FilePath is a virtual file that we have allocated.
+  bool isFileVirtual(StringRef FilePath);
+
----------------
If we decided we need this (see further down), this'll need approval from 
Doug...


http://llvm-reviews.chandlerc.com/D1800
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to