[cfe-commits] r45747 - in /cfe/trunk/Driver: ASTConsumers.cpp ASTConsumers.h clang.cpp
Ted Kremenek
kremenek at apple.com
Tue Jan 8 10:04:07 PST 2008
Author: kremenek
Date: Tue Jan 8 12:04:06 2008
New Revision: 45747
URL: http://llvm.org/viewvc/llvm-project?rev=45747&view=rev
Log:
Added most of the boilerplate to the driver needed to run the graph-reachability
constant propagation analysis.
Modified:
cfe/trunk/Driver/ASTConsumers.cpp
cfe/trunk/Driver/ASTConsumers.h
cfe/trunk/Driver/clang.cpp
Modified: cfe/trunk/Driver/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=45747&r1=45746&r2=45747&view=diff
==============================================================================
--- cfe/trunk/Driver/ASTConsumers.cpp (original)
+++ cfe/trunk/Driver/ASTConsumers.cpp Tue Jan 8 12:04:06 2008
@@ -552,6 +552,25 @@
}
//===----------------------------------------------------------------------===//
+// GRConstProp - Perform intra-procedural, path-sensitive constant propagation.
+
+namespace {
+ class GRConstPropVisitor : public CFGVisitor {
+ public:
+ virtual void Initialize(ASTContext &Context) {}
+
+ virtual void VisitCFG(CFG& C) {
+ // FIXME: Implement.
+ assert (false && "Not yet implemented.");
+ }
+ };
+} // end anonymous namespace
+
+ASTConsumer *clang::CreateGRConstProp() {
+ return new GRConstPropVisitor();
+}
+
+//===----------------------------------------------------------------------===//
// LLVM Emitter
#include "clang/Basic/Diagnostic.h"
Modified: cfe/trunk/Driver/ASTConsumers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.h?rev=45747&r1=45746&r2=45747&view=diff
==============================================================================
--- cfe/trunk/Driver/ASTConsumers.h (original)
+++ cfe/trunk/Driver/ASTConsumers.h Tue Jan 8 12:04:06 2008
@@ -38,6 +38,8 @@
ASTConsumer *CreateDeadStoreChecker(Diagnostic &Diags);
ASTConsumer *CreateUnitValsChecker(Diagnostic &Diags);
+
+ASTConsumer *CreateGRConstProp();
ASTConsumer *CreateLLVMEmitter(Diagnostic &Diags, const LangOptions &Features);
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=45747&r1=45746&r2=45747&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Tue Jan 8 12:04:06 2008
@@ -64,6 +64,7 @@
ParseCFGDump, // Parse ASTS. Build CFGs. Print CFGs.
ParseCFGView, // Parse ASTS. Build CFGs. View CFGs.
AnalysisLiveVariables, // Print results of live-variable analysis.
+ AnalysisGRConstProp, // Perform graph-reachability constant prop.
WarnDeadStores, // Run DeadStores checker on parsed ASTs.
WarnDeadStoresCheck, // Check diagnostics for "DeadStores".
WarnUninitVals, // Run UnitializedVariables checker.
@@ -108,6 +109,8 @@
"Flag warnings of stores to dead variables."),
clEnumValN(WarnUninitVals, "warn-uninit-values",
"Flag warnings of uses of unitialized variables."),
+ clEnumValN(AnalysisGRConstProp, "gr-const-prop",
+ "Perform path-sensitive constant propagation."),
clEnumValN(TestSerialization, "test-pickling",
"Run prototype serializtion code."),
clEnumValN(EmitLLVM, "emit-llvm",
@@ -925,6 +928,9 @@
case WarnUninitVals:
return CreateUnitValsChecker(Diag);
+ case AnalysisGRConstProp:
+ return CreateGRConstProp();
+
case TestSerialization:
return CreateSerializationTest(Diag, FileMgr, LangOpts);
More information about the cfe-commits
mailing list