aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-08 05:11:16 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-08 05:11:16 +0000
commitc9abc043af88f90d177a5bd147f627b78ca49fde (patch)
treed767381f7166211a708c2f4f71f144ac2b7717d2 /include/clang/Basic
parent797a2479dac447138a6276eb5e9fb6ad4f61fd92 (diff)
Make debug info work when using -save-temps.
- This is pretty ugly, but the most obvious solution. Chime in if you have a nicer one. - The problem is that with -save-temps, clang-cc has no idea what the name of the original input file is. However, the user expects to be able to set breakpoints based on the input file name. - We support this by providing a new option -main-file-name (similar to -dumpbase used by gcc) which allows the driver to pass in the original file name. - <rdar://problem/6753383> building with clang using --save-temps gets the compile unit name from the .i file... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic')
-rw-r--r--include/clang/Basic/LangOptions.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h
index f746edb65f..f95024dd88 100644
--- a/include/clang/Basic/LangOptions.h
+++ b/include/clang/Basic/LangOptions.h
@@ -76,6 +76,11 @@ private:
// signed. Set/Query this value using accessors.
unsigned SymbolVisibility : 3; // Symbol's visibility.
+ /// The user provided name for the "main file", if non-null. This is
+ /// useful in situations where the input file name does not match
+ /// the original input file, for example with -save-temps.
+ const char *MainFileName;
+
public:
unsigned InstantiationDepth; // Maximum template instantiation depth.
@@ -110,11 +115,16 @@ public:
OptimizeSize = 0;
PICLevel = 0;
+
+ MainFileName = 0;
}
GCMode getGCMode() const { return (GCMode) GC; }
void setGCMode(GCMode m) { GC = (unsigned) m; }
+ const char *getMainFileName() const { return MainFileName; }
+ void setMainFileName(const char *Name) { MainFileName = Name; }
+
VisibilityMode getVisibilityMode() const { return (VisibilityMode) SymbolVisibility; }
void setVisibilityMode(VisibilityMode v) { SymbolVisibility = (unsigned) v; }