]> granicus.if.org Git - clang/commitdiff
Remove 'LangOpts' from Diagnostic (added in http://llvm.org/viewvc/llvm-project?view...
authorSteve Naroff <snaroff@apple.com>
Sat, 5 Dec 2009 12:23:07 +0000 (12:23 +0000)
committerSteve Naroff <snaroff@apple.com>
Sat, 5 Dec 2009 12:23:07 +0000 (12:23 +0000)
Simply use the 'LangOpts' member already present in TextDiagnosticPrinter.

Sorry for the confusion!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90664 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Diagnostic.h
lib/Basic/Diagnostic.cpp
lib/Frontend/TextDiagnosticPrinter.cpp
tools/clang-cc/clang-cc.cpp

index b9d19674af08b897aa0a03890f4ad423d412a3f1..b2523f28d5e0153fd3e72ad721c1c419d5a8c658 100644 (file)
@@ -182,7 +182,6 @@ private:
   bool SuppressAllDiagnostics;   // Suppress all diagnostics.
   ExtensionHandling ExtBehavior; // Map extensions onto warnings or errors?
   DiagnosticClient *Client;
-  LangOptions *LangOpts;
 
   /// DiagMappings - Mapping information for diagnostics.  Mapping info is
   /// packed into four bits per diagnostic.  The low three bits are the mapping
@@ -239,9 +238,6 @@ public:
   DiagnosticClient *getClient() { return Client; }
   const DiagnosticClient *getClient() const { return Client; }
 
-  LangOptions *getLangOpts() const { return LangOpts; }
-  void setLangOpts(LangOptions *LOpts) { LangOpts = LOpts; }
-  
   /// pushMappings - Copies the current DiagMappings and pushes the new copy
   /// onto the top of the stack.
   void pushMappings();
index 1f5179146b6bec97bdbdd82cf26e04d8c61b7dfd..8d0d81326db0f8ffa3e02b6ebf4eadfb08bf0104 100644 (file)
@@ -210,7 +210,6 @@ Diagnostic::Diagnostic(DiagnosticClient *client) : Client(client) {
   ErrorOccurred = false;
   FatalErrorOccurred = false;
   NumDiagnostics = 0;
-  LangOpts = 0;
   
   NumErrors = 0;
   CustomDiagInfo = 0;
index eeca97d62a815eef75b1618f574ff692367a412c..f8bb21ddee9f6dc23c61fbc93d9c48e45b02178e 100644 (file)
@@ -655,9 +655,7 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,
         OS.changeColor(savedColor, true);
       
       // Emit a Visual Studio compatible line number syntax.
-      // This check is a bit paranoid (in case LangOpts isn't set).
-      if (Info.getDiags() && Info.getDiags()->getLangOpts() &&
-          Info.getDiags()->getLangOpts()->Microsoft) {
+      if (LangOpts && LangOpts->Microsoft) {
         OS << PLoc.getFilename() << '(' << LineNo << ')';
         OS << " : ";
       } else {
index fbc2847a9290089fba26be00e35a2a533526c403..11a4f242737792c663f7bd473af1ca6b63474438 100644 (file)
@@ -236,8 +236,6 @@ int main(int argc, char **argv) {
   Clang.createDiagnostics(argc, argv);
   if (!Clang.hasDiagnostics())
     return 1;
-
-  Clang.getDiagnostics().setLangOpts(&Clang.getLangOpts());
   
   // Set an error handler, so that any LLVM backend diagnostics go through our
   // error handler.