aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-09-08 17:15:01 +0000
committerEric Christopher <echristo@apple.com>2011-09-08 17:15:01 +0000
commit29f39425fc7fcaede88a7e573f392975f8dc5e3e (patch)
tree3569ef8a08bc683c2fa79f7c19d62e8b593e7db9 /include/clang/Basic/SourceManager.h
parent62f940bff18f1e0d48466b08d2b61d137ebb65bd (diff)
Add a block comment explaining how the different source locations work
including some source examples. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139295 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index af5f76969a..d1d2a91681 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -38,6 +38,22 @@ class LangOptions;
class ASTWriter;
class ASTReader;
+/// There are three different types of locations in a file: a spelling
+/// location, an expansion location, and a presumed location.
+///
+/// Given an example of:
+/// #define min(x, y) x < y ? x : y
+///
+/// and then later on a use of min:
+/// return min(a, b);
+/// #line 17
+///
+/// The expansion location is the line in the source code where the macro
+/// was expanded (the return statement), the spelling location is the
+/// location in the source where the macro was originally defined,
+/// and the presumed location is where the line directive states that
+/// the line is 17, or any other line.
+
/// SrcMgr - Public enums and private classes that are part of the
/// SourceManager implementation.
///