Summary: This is old and not used. Reviewed By: akotulski Differential Revision: D3981331 fbshipit-source-id: 41fe5c6master
							parent
							
								
									a9f1d21dd2
								
							
						
					
					
						commit
						af4f65a871
					
				| @ -1,31 +0,0 @@ | ||||
| # Copyright (c) 2004 - present Facebook, Inc. | ||||
| # All rights reserved. | ||||
| # | ||||
| # This source code is licensed under the BSD style license found in the | ||||
| # LICENSE file in the root directory of this source tree. An additional grant | ||||
| # of patent rights can be found in the PATENTS file in the same directory. | ||||
| 
 | ||||
| set(MODULE TRUE) | ||||
| 
 | ||||
| set(LLVM_LINK_COMPONENTS support mc) | ||||
| 
 | ||||
| add_clang_library(infer-plugin InferPlugin.cpp) | ||||
| 
 | ||||
| add_dependencies(infer-plugin | ||||
|   ClangAttrClasses | ||||
|   ClangAttrList | ||||
|   ClangCommentNodes | ||||
|   ClangDeclNodes | ||||
|   ClangDiagnosticCommon | ||||
|   ClangStmtNodes | ||||
|   ) | ||||
| 
 | ||||
| target_link_libraries(infer-plugin | ||||
|   clangFrontend | ||||
|   clangAST | ||||
|   ) | ||||
| 
 | ||||
| set_target_properties(infer-plugin | ||||
|   PROPERTIES | ||||
|   LINKER_LANGUAGE CXX | ||||
|   PREFIX "") | ||||
| @ -1,64 +0,0 @@ | ||||
| /*
 | ||||
|  * Copyright (c) 2004 - present Facebook, Inc. | ||||
|  * All rights reserved. | ||||
|  * | ||||
|  * This source code is licensed under the BSD style license found in the | ||||
|  * LICENSE file in the root directory of this source tree. An additional grant | ||||
|  * of patent rights can be found in the PATENTS file in the same directory. | ||||
|  */ | ||||
| 
 | ||||
| #include "clang/Frontend/FrontendPluginRegistry.h" | ||||
| #include "clang/AST/AST.h" | ||||
| #include "clang/AST/ASTConsumer.h" | ||||
| #include "clang/Frontend/CompilerInstance.h" | ||||
| #include "llvm/Support/raw_ostream.h" | ||||
| using namespace clang; | ||||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| class PrintFunctionsConsumer : public ASTConsumer { | ||||
|  public: | ||||
|   virtual bool HandleTopLevelDecl(DeclGroupRef DG) { | ||||
|     for (DeclGroupRef::iterator i = DG.begin(), e = DG.end(); i != e; ++i) { | ||||
|       const Decl* D = *i; | ||||
|       if (const NamedDecl* ND = dyn_cast<NamedDecl>(D)) | ||||
|         llvm::errs() << "top-level-decl: \"" << ND->getNameAsString() << "\"\n"; | ||||
|     } | ||||
| 
 | ||||
|     return true; | ||||
|   } | ||||
| }; | ||||
| 
 | ||||
| class PrintFunctionNamesAction : public PluginASTAction { | ||||
|  protected: | ||||
|   ASTConsumer* CreateASTConsumer(CompilerInstance& CI, llvm::StringRef) { | ||||
|     return new PrintFunctionsConsumer(); | ||||
|   } | ||||
| 
 | ||||
|   bool ParseArgs(const CompilerInstance& CI, | ||||
|                  const std::vector<std::string>& args) { | ||||
|     for (unsigned i = 0, e = args.size(); i != e; ++i) { | ||||
|       llvm::errs() << "toplevel-plugin arg = " << args[i] << "\n"; | ||||
| 
 | ||||
|       // Example error handling.
 | ||||
|       if (args[i] == "-an-error") { | ||||
|         DiagnosticsEngine& D = CI.getDiagnostics(); | ||||
|         unsigned DiagID = D.getCustomDiagID( | ||||
|             DiagnosticsEngine::Error, "invalid argument '" + args[i] + "'"); | ||||
|         D.Report(DiagID); | ||||
|         return false; | ||||
|       } | ||||
|     } | ||||
|     if (args.size() && args[0] == "help") | ||||
|       PrintHelp(llvm::errs()); | ||||
| 
 | ||||
|     return true; | ||||
|   } | ||||
|   void PrintHelp(llvm::raw_ostream& ros) { | ||||
|     ros << "Help for toplevel-plugin plugin goes here\n"; | ||||
|   } | ||||
| }; | ||||
| } | ||||
| 
 | ||||
| static FrontendPluginRegistry::Add<PrintFunctionNamesAction> X( | ||||
|     "infer-plugin", "print function names"); | ||||
| @ -1,16 +0,0 @@ | ||||
| # Copyright (c) 2004 - present Facebook, Inc.
 | ||||
| # All rights reserved.
 | ||||
| #
 | ||||
| # This source code is licensed under the BSD style license found in the
 | ||||
| # LICENSE file in the root directory of this source tree. An additional grant
 | ||||
| # of patent rights can be found in the PATENTS file in the same directory.
 | ||||
| BD=~/clang-llvm/build | ||||
| 
 | ||||
| all: | ||||
| 	/usr/local/bin/clang++ -DGNU_SOURCE -D_DEBUG -D_STDC_CONSTANT_MACROS \
 | ||||
| 	        -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS \
 | ||||
| 					-I$(BD)/tools/clang/include -I$(BD)/lib/clang/3.4/include -I$(BD)/include \
 | ||||
| 					-Xclang -load -Xclang $(BD)/lib/infer-plugin.so \
 | ||||
| 					-Xclang -plugin -Xclang infer-plugin \
 | ||||
| 					test.cpp -fsyntax-only | ||||
| 
 | ||||
| @ -1,22 +0,0 @@ | ||||
| /*
 | ||||
|  * Copyright (c) 2004 - present Facebook, Inc. | ||||
|  * All rights reserved. | ||||
|  * | ||||
|  * This source code is licensed under the BSD style license found in the | ||||
|  * LICENSE file in the root directory of this source tree. An additional grant | ||||
|  * of patent rights can be found in the PATENTS file in the same directory. | ||||
|  */ | ||||
| 
 | ||||
| int main() { return 0; } | ||||
| 
 | ||||
| void f() { | ||||
|   for (int i = 0; i < 10; i++) { | ||||
|     ; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| void g() { | ||||
|   for (int i = 1; i < 10; i++) { | ||||
|     ; | ||||
|   } | ||||
| } | ||||
					Loading…
					
					
				
		Reference in new issue